none
How to specify Data source and Report Source RRS feed

  • Question

  • Hi I made the following code To bing automatically Report source to a Reportviewer.

    I am wondering if The data source shoul have the ""

    What should reportDataSource.Name  and reportViewer1.LocalReport.ReportEmbeddedResource shoudl be formated.

    Thank you.

    Microsoft.Reporting.WinForms.ReportDataSource reportDataSource = new         Microsoft.Reporting.WinForms.ReportDataSource();

            
    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
            
    { reportViewer1.Reset();
               
               
    switch(comboBox1.SelectedItem.ToString())
            
    {
                   
    case "Report1":
                     reportDataSource
    .Name = "Reports_GetReport1Report";
                        reportDataSource
    .Value = igoDataSet1 ;
                        reportViewer1
    .LocalReport.DataSources.Add(reportDataSource);
                        reportViewer1
    .LocalReport.ReportEmbeddedResource = "Reportsapplication5.Report1.rdlc";

                        reportViewer1
    .RefreshReport();
                       
    break;
                   
    case "Report2":
                        reportDataSource
    .Name = "Reports_GetReport2Report";
                        reportDataSource
    .Value = igoDataSet1;
                        reportViewer1
    .LocalReport.DataSources.Add(reportDataSource);
                        reportViewer1
    .LocalReport.ReportEmbeddedResource = "Reportsapplication5.Report2.rdlc";
                        reportViewer1
    .RefreshReport();
                       
    break;
               
    }
           
    }


    Thursday, April 19, 2012 7:50 PM

All replies