Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 24-Jan-13 21:06pm
Edited 24-Jan-13 21:07pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
PunithaSabareeswari at 6-Feb-13 3:19am
   
Thank You
Teju MB at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,434
1 OriginalGriff 6,178
2 Peter Leow 2,534
3 Abhinav S 2,274
4 Maciej Los 2,268


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100