none
Subreports in local report mode do not work RRS feed

  • Question

  • How do you get SubReports to work with LocalReport? I have a main report with data. Works fine. The report is ClientReportMTD.rdlc and is set as an embedded resource that is not copied. I have another report, with no data in it, called Cover.rdlc. It is also an Embedded Resource, no copy. The ClientReportMTD works fine. When I try to add Cover.rdlc as a subreport, I always get Error: Subreport could not be shown. I've wired all of the events and I catch exceptions, none of which are occuring.

    When I load the main form I have the following code:

    datasetClientReport.Clear();
    int clientID = -1;
    DateTime date = dateTimePickerReportDate.Value;
    this.reportViewer1.LocalReport.ReportEmbeddedResource = "Gargoyle.OverlayServices.Reporting.ClientReportMTD.rdlc";
    if (comboBoxClient.SelectedValue != null)
    {
    clientID = (
    int)comboBoxClient.SelectedValue;
    DateTime dt = dateTimePickerReportDate.Value;
    m_mtdDataAdapter.Fill(clientID, dt.Year, dt.Month, datasetClientReport);
    this.reportViewer1.LocalReport.DataSources.Clear();
    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ClientReportDataset_MTD_Summary", datasetClientReport.MTD_Summary));
    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ClientReportDataset_MTD_OptionsPortfolio", datasetClientReport.MTD_OptionsPortfolio));
    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ClientReportDataset_MTD_ClientPortfolio", datasetClientReport.MTD_ClientPortfolio));this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ClientReportDataset_MTD_CombinedPortfolio", datasetClientReport.MTD_CombinedPortfolio));
    this.reportViewer1.ReportError += new ReportErrorEventHandler(reportViewer1_ReportError);
    this.reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
    this.reportViewer1.RefreshReport();

     

    Not only

    Wednesday, December 9, 2009 5:14 PM