Click here to Skip to main content
15,885,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dim ds As New Crystal_DS
        Dim DT_TAB As DataTable = ds.Tables.Add("Summary")
        If LV.Items.Count > 1 Then
            For i As Integer = 0 To LV.Items(0).SubItems.Count - 1
                Dim DCOL As New DataColumn(LV.Columns(i).Text)
                DT_TAB.Columns.Add(DCOL)
            Next
        End If
        For i As Integer = 0 To LV.Items.Count - 1
            Dim DROW As DataRow = DT_TAB.NewRow
            For j As Integer = 0 To LV.Items(i).SubItems.Count - 1
                DROW(LV.Columns(j).Text) = LV.Items(i).SubItems(j).Text
            Next
            DT_TAB.Rows.Add(DROW)
        Next
        DataGridView1.DataSource = ds.Tables("Summary")
        'ds.Tables.Add(DT_TAB)
        ds.AcceptChanges()
        Dim objRpt As New TripSheet
        Dim strReportPath As String = Application.StartupPath & "\Cry_Chart\TripSheet.rpt"
        objRpt.Load(strReportPath)
        objRpt.SetDataSource(ds.Tables("Summary"))
        CrystalReportViewer1.ReportSource = objRpt
        'CrystalReportViewer1.DataBind()

I used above the lines for view the crystal report.... but nothing display while program execution time... and also no error....
I try to read the data from the listview and convert to data table. Finally display the datatable in the crystal report...
Posted
Updated 24-Jan-13 20:07pm
v2

1 solution

If your report is displaying but no data then there may be chances where CR wants your data to already be there .
Your .NET program has to put data into the dataset prior to running the report that reads the dataset. How this is done is dependent on how you've set up your dataset.
If it's tables, you can just open the tables. If it's based on a query, you have to run the query. If the data is generated through code, then you have to generate the data.
(For example, I have an app that does a user audit from Business Objects Enterprise XI. It gets the user information from BO XI through the SDK and saves it to a table in the dataset. It then reads user information from our security database and updates the table based on that. Then it opens up the audit report.)

Hope it helps.
 
Share this answer
 
Comments
PunithaSabareeswari 6-Feb-13 3:19am    
Thank You
The Doer 6-Feb-13 10:08am    
Is that solves your problem, if so accept this as an answer. if not post the solution if you find any such that it can help to others.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900