CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Populating a Crystal Report

    I am having an issue with my report not getting populated. I have confirmed that the datatables are populated with the correct data, there are multiple datatables involved in creating this report. Below is the code I am using to populate the tables and create the report.

    I pass each datatable to a Sub that make corrections to the datatable and then update it.



    Code:
           ds.dtCAFRreports.Clear()
            Dim taICT As New dsCAFRreportsTableAdapters.dtIncContTranTableAdapter
            taICT.Fill(ds.dtIncContTran, Me.cmbPeriodName.SelectedValue.ToString())
            Dim taNORE As New dsCAFRreportsTableAdapters.dtNonOpRevExpTableAdapter
            taNORE.Fill(ds.dtNonOpRevExp, Me.cmbPeriodName.SelectedValue.ToString())
            Dim taOE As New dsCAFRreportsTableAdapters.dtOpExpTableAdapter
            taOE.Fill(ds.dtOpExp, Me.cmbPeriodName.SelectedValue.ToString())
            Dim taOR As New dsCAFRreportsTableAdapters.dtOpRevTableAdapter
            taOR.Fill(ds.dtOpRev, Me.cmbPeriodName.SelectedValue.ToString())
            
            'Edit (dtOpRev) 
            reviseTable(ds.dtOpRev)
            ds.dtOpRev.AcceptChanges()
            'Edit(dtOpExp)
            reviseTable(ds.dtOpExp)
            ds.dtOpExp.AcceptChanges()
            'Edit(dtOpIncContTran)
            reviseTable(ds.dtIncContTran)
            ds.dtIncContTran.AcceptChanges()
            'Edit dtNonOpRevExp
            reviseTable(ds.dtNonOpRevExp)
            ds.dtNonOpRevExp.AcceptChanges()
    
            Dim rep As String = My.Settings.DetailReport
            Dim report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            report.FileName = rep
            report.SetDataSource(ds)
            Me.crViewer.ReportSource = report
            Me.Enabled = True
            Me.crViewer.RefreshReport()
            Me.Refresh()
            Me.Cursor = Cursors.Default
    Last edited by HanneSThEGreaT; July 16th, 2010 at 01:06 AM. Reason: Added [CODE] tags.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Populating a Crystal Report

    Welcome to the forums dungbeetle!

    Please make sure to post your code in [CODE] tags next time. It is explained here :

    http://www.codeguru.com/forum/showthread.php?t=403073

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Populating a Crystal Report

    Might want to post in the Crystal Reports forum
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured