none
Issue: Only first report dataset shows up - others don't show any data - no error msg RRS feed

  • Question

  • Hi,
    In the past, I had no problem plugging & refreshing reports in ReportViewer (WinForms), however lately I'm having issues (I rarely use the ReportViewer, so I am probably doing something wrong).
    1 - In BIDS 2008r2, I build a report with 2 report datasets, then I add a table for each dataset showing the rows (no summation or grouping).
    --> I run it in BIDS, it works: all tables show data from their corresponding dataset. I run it in ReportBuilder3, same result, it works.
    2 - In a VS2010 project, i create a Form with a ReportViewer. I code, using Local Processing, I load the rdl I created in (1), load/push the data and refresh.
    --> Only the first table shows data, the second table is empty.
    Checks:
    - I checked the dataset names in the rdl and made sure i am using the same names in code (case sensitive).
    - I made sure that the ReportDataSource objects have the expected data before adding them to LocalReport.DataSources
    Tests:
    - I simplified and removed the tables and replaced by textboxes with expressions like =CountRows("dataset1") --> all textboxes show 0 except for 1st dataset, i.e. same unexpected result.
    - In the code, I switch the order in which I add the ReportDataSources --> same result (which was expected)
    - Now interestingly, if i re-order the datasets in the report in BIDS (eg say dataset2 is now the first dataset in the rdl) and I run the code (the code has NOT changed), then dataset2 gets data i.e. the second table2 shows data and table1 becomes the dataset that doesn't show data anymore.
    - another test: I downloaded and ran the report viewer from gotreportviewer.com --> same result
    - I tried creating other simple reports with multiple datasets --> same behavior
    - I tried an old report rdl I had created a year ago --> it works fine!... (at that time, i was using a different computer)
    Any idea what I am doing wrong?
    Now the code:
            'Retrieve data
            Dim Results1 As DataSet = GetData()
            Dim summary As DataTable = Results1.Tables(0)
            Dim header As DataTable = Results1.Tables(1)
    
            'Reset viewer and load rdl
            ReportViewer.Reset()
            ReportViewer.ProcessingMode = ProcessingMode.Local
            ReportViewer.LocalReport.ReportPath = "....\Report1.rdlc"
    
            'Add datasources to report
            ReportViewer.LocalReport.DataSources.Clear()
            ReportViewer.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", header))       
            ReportViewer.LocalReport.DataSources.Add(New ReportDataSource("DataSet2", summary)) 
    
            'Refresh
            ReportViewer.LocalReport.Refresh()
            ReportViewer.RefreshReport()
    

    Thank you for any help you can provide,
    Sebastien
    Thursday, January 12, 2012 9:05 PM

Answers

  • Thank you for your reply Sygrien. I have found the issue.

    First, to answer your questions. 1) rdl/rdlc : that's a typo when i re-typed the path in this post; we manually build rdl files in bids then I load the rdl in reportviewer; i am aware of the viewer only reading the 'rdlc'-subset schema. That usually works fine.  2) The db stored proc returns 2 SELECTs therefore 2 datatables within a single dataset. These datatables are not dependent.

    Now, my findings. I compared the xml of some reports I had build a year and that still worked vs the current failing reports. Among other things, in the new/fail reports there was a tag <Transaction>true</Transaction>. This correspond to the option "Use single transaction when processing the queries" being checked in the report's datasource properties in bids. 

    Removing this tag from the xml or unchecking the checkbox in bids fixed the issue; i now see all datasets in the report.

    Thank you,

    Sebastien 

    Friday, January 13, 2012 4:27 PM

All replies

  • Sebastien,

    In your description, you mention an .rdl file (in your point number 1), but in your code, you load an .rdlc file.

    Question, in your report, do you link the two Datasets (they are called header and summary.... does this mean there is a dependency ?)

    Friday, January 13, 2012 1:12 PM
  • Thank you for your reply Sygrien. I have found the issue.

    First, to answer your questions. 1) rdl/rdlc : that's a typo when i re-typed the path in this post; we manually build rdl files in bids then I load the rdl in reportviewer; i am aware of the viewer only reading the 'rdlc'-subset schema. That usually works fine.  2) The db stored proc returns 2 SELECTs therefore 2 datatables within a single dataset. These datatables are not dependent.

    Now, my findings. I compared the xml of some reports I had build a year and that still worked vs the current failing reports. Among other things, in the new/fail reports there was a tag <Transaction>true</Transaction>. This correspond to the option "Use single transaction when processing the queries" being checked in the report's datasource properties in bids. 

    Removing this tag from the xml or unchecking the checkbox in bids fixed the issue; i now see all datasets in the report.

    Thank you,

    Sebastien 

    Friday, January 13, 2012 4:27 PM