Beginner for creating Crystal Report with VB.NET2008 WinForm
-
Hello all,I'm new to using Crystal Reports and VB.NET Programming here. I have try to Google for how it works. Currently I'm able to show my Blank Reports by Clicking a Button2. I have to ask anyone can tell me how to display my data using the Crystal Report? The following are the code I'm currently working with:
'When the following button Click,the Report will showout.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objRpt As New FrmCrystalRpt
objRpt.strRptName = New CachedCrystalReport1objRpt.Show() End Sub
'The below is my ReportViewer WinForm
Public Class FrmCrystalRpt
Public strRptName As Object
Public strRptFilter As StringPrivate Sub FrmCrystalRpt\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If strRptFilter <> "" Then crptVW.SelectionFormula = strRptFilter End If crptVW.ReportSource = strRptName crptVW.Show() End Sub
End Class
Currently my report showing nothing,I'm wondering how could I make this report show my selection of data from the MySQL5.0 database? I'm using MySQL ODBC3.51 Driver to connect my Database=logistic_sysdb. I wish the Crystal Report can show my selection of data below:
Dim SQL4 As String
selectmonth = ComboBox2.SelectedItemSQL4 = "SELECT \* FROM lorry\_commission WHERE Lorry\_No='" & ComboBox1.SelectedItem & "' AND MONTH(Date)='" & selectmonth & "';" Try ObjMyConn.Open() ObjAdapter = New MySqlDataAdapter(SQL, ObjMyConn) ObjAdapter.Fill(ds, "Salary44") Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly) Finally ObjMyConn.Close() End Try
I guess some parameter is needed to be passed into the Crystal Report as well. How to do that? Anyone can give me a sample is better so I can learn easier to solve this. Thanks for reading. Drex
-
Hello all,I'm new to using Crystal Reports and VB.NET Programming here. I have try to Google for how it works. Currently I'm able to show my Blank Reports by Clicking a Button2. I have to ask anyone can tell me how to display my data using the Crystal Report? The following are the code I'm currently working with:
'When the following button Click,the Report will showout.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objRpt As New FrmCrystalRpt
objRpt.strRptName = New CachedCrystalReport1objRpt.Show() End Sub
'The below is my ReportViewer WinForm
Public Class FrmCrystalRpt
Public strRptName As Object
Public strRptFilter As StringPrivate Sub FrmCrystalRpt\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If strRptFilter <> "" Then crptVW.SelectionFormula = strRptFilter End If crptVW.ReportSource = strRptName crptVW.Show() End Sub
End Class
Currently my report showing nothing,I'm wondering how could I make this report show my selection of data from the MySQL5.0 database? I'm using MySQL ODBC3.51 Driver to connect my Database=logistic_sysdb. I wish the Crystal Report can show my selection of data below:
Dim SQL4 As String
selectmonth = ComboBox2.SelectedItemSQL4 = "SELECT \* FROM lorry\_commission WHERE Lorry\_No='" & ComboBox1.SelectedItem & "' AND MONTH(Date)='" & selectmonth & "';" Try ObjMyConn.Open() ObjAdapter = New MySqlDataAdapter(SQL, ObjMyConn) ObjAdapter.Fill(ds, "Salary44") Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly) Finally ObjMyConn.Close() End Try
I guess some parameter is needed to be passed into the Crystal Report as well. How to do that? Anyone can give me a sample is better so I can learn easier to solve this. Thanks for reading. Drex
-
I'm still wondering how to use that Crystal Report? Anyone can let me know how to show a dataset table result using a Crystal Report after clicking a button? And how can I pass 3 string parameter to the Crystal report? Thanks for reading. Drex