Hi,

Can anyone help me in showing multiple items from listview to my crystal report.
Or something like after searching some items, the results are the one to be displayed in crystal report. I don't have any codes yet. I'm using OLE DB Connection.

Any help would be appreciated.

Thank you for the help!:icon_cheesygrin::icon_cheesygrin::icon_cheesygrin::icon_cheesygrin:

Recommended Answers

All 3 Replies

All you need to do is:
1)Create a dataset (and datatable inside of it). You may pull the table from your listView

2)At the crystal report, right click your report and select database expert, add in the dataset u created

3)Design your layout of your report.

Thank you very much!!:icon_cheesygrin::icon_cheesygrin::icon_cheesygrin::icon_cheesygrin:

But may I know the code for that??

Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
        Dim con1 As OleDb.OleDbConnection = New OleDbConnection
        Dim strsql As String

        con1.Close()
        con1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\Users\Jairuz\Desktop\PESO Inventory\PESO Inventory\dbInventory.mdb"
        con1.Open()

        strsql = "Select * from Inventory"

        Dim DA As New OleDbDataAdapter(strsql, con1)
        Dim DS As New DataSet

        DA.Fill(DS, "Inventory")

        Dim strReportPath As String = "C:\Users\Jairuz\Desktop\PESO Inventory\PESO Inventory\CrystalReport1.rpt"


        Dim cr As New ReportDocument

        cr.Load(strReportPath)
        cr.SetDataSource(DS.Tables("Inventory"))

        frmPrint.CrystalReportViewer1.ReportSource = cr
        frmPrint.Show()
    End Sub

this is my current code.. then how may I display the selected items (if multiple can be)
in the crystal report. and I was finding it on strsql area..

that's only my problem for now..

thanks for the help!:icon_cheesygrin::icon_cheesygrin::icon_cheesygrin::icon_cheesygrin::icon_cheesygrin:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.