none
Multiple Datasources in ReportDatasource

    Question

  • gud day,

    is it posible to have multiple report datasources??

    something like this.

            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Operational_Operational_Status", ds.Tables["Operational_Status"]));
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Operational_Operational_Priority", ds1.Tables["Operational_Priority"]));
    i feel like the Operational_Priority datasources is always overwriting the first one which is Operational_status. that's why in the runtime it cannot find the operational_status.

    any comments and suggestion is much appreciated.
    thanks,
    ivan
    Wednesday, March 10, 2010 3:14 AM

Answers

  • i have already fixed this. i have different error. but right now i have already identified it.

    thanks.
    • Marked as answer by jihmantiquilla Wednesday, March 10, 2010 8:35 AM
    Wednesday, March 10, 2010 5:42 AM

All replies

  • i have already fixed this. i have different error. but right now i have already identified it.

    thanks.
    • Marked as answer by jihmantiquilla Wednesday, March 10, 2010 8:35 AM
    Wednesday, March 10, 2010 5:42 AM
  • Dear Jihmantiquilla,

    Iam generating the pdf file out this code using 2 datatables of dataset, but in the data is displaying only of ds.Tables[0] , not of ds.Tables[1].

    my code is as below .

    ReportViewer viewer = new ReportViewer();
                
               viewer.ProcessingMode = ProcessingMode.Local;
               viewer.Reset();
               viewer.LocalReport.ReportEmbeddedResource = @"D:\Projects\NIKHIL\NIKHIL\Report3.rdlc;
               viewer.LocalReport.ReportPath = @"D:\Projects\NIKHIL\NIKHIL\Report3.rdlc;
            
               viewer.LocalReport.DataSources.Clear();
               viewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", ds.Tables[0]));
               viewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", ds.Tables[1]));
                
               viewer.LocalReport.Refresh();          
     
               
               byteViewer = viewer.LocalReport.Render(reportType, deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings);
     

               returnbyteViewer;

    Please suggest solution..


    Saturday, January 05, 2013 8:25 AM