Results 1 to 4 of 4

Thread: Cannot view crystal report through dataset bind.

  1. #1

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Cannot view crystal report through dataset bind.

    Hi.
    I have a dataset with a datatable.
    I have created the datatable on the designer by I manually populate it (see code below).
    I bind the crystal report datasource to the dataset and I try to view it in crystal report viewer.
    It will show me an empty crystal report.
    Any help?
    My main goal is to export the report to pdf but I would like first to see how the report looks like on the viewer.

    I'm not sure how the report behaves since I find use the database wizard of the report to bind it to the dataset, so I can drow field on the report
    but then I bind the "as new dataset" back again to the report.

    code that matters:

    Code:
       Dim d1 As New DataSet1
                            Dim ddt As New DataTable
                            ddt = clsG.ConvertToDataTable(lstloyaltySendTrnasaction)
                            d1.BeginInit()
                            For Each dr As DataRow In ddt.Rows
    
                                Try
    
                                    d1.LoyaltyDataTable.ImportRow(dr)
    
                                Catch ex As Exception
    
                                End Try
                            Next
                            'd1.EndInit()
                            d1.AcceptChanges()
    
                            CrystalReport11.SetDataSource(d1)
    
                            Try
                                ''  Dim cr As New CrystalReport1
                                '' cr.SetDataSource(d1)
                                '  CrystalReportViewer1.ReportSource = CrystalReport11
                                CrystalReportViewer1.Refresh()
                                'CrystalReport11.SetDataSource(d1)
                            Catch ex As Exception
    
                            End Try
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  2. #2

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Cannot view crystal report through dataset bind.

    Hi.
    Ok don't know what was happening before but it now work.
    I have another problem though.
    I only see one row of data in the report view, when I have more than one row in there.
    I cannot use immediate window to see the crystal report row count as downing this:
    ?cr.Rows.Count , does nothing and the IDE looks like bugs out.

    Made the ide work.
    so ?cr.Rows(0).tostring() rows(1).tostring, rows(2). tostring will show fine.
    I cannot however see all the rows in the crystal report viewer.
    I try the below. First name does not show, email will show

    Name:  Clipboard01.jpg
Views: 238
Size:  15.3 KB
    Last edited by sapator; Apr 5th, 2018 at 06:46 AM.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Cannot view crystal report through dataset bind.

    One line only. I have more rows in the dataset
    Attachment 157965
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  4. #4

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Cannot view crystal report through dataset bind.

    Hmmm. now it shows data?????
    I did not do anything, just closed opened the solution! WTH?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width