Drill-Through Reports as Embedded Resource

Posted by: mdynna on 26 March 2020, 6:05 am EST

  • Posted 26 March 2020, 6:05 am EST

    I've been experimenting with Drill-Through Page reports. It seems they do not work when the reports as set as Embedded Resources within the assembly. Clicking on a control in the report that activates the secondary report produces the following exception:
    Exception details:
    System.Exception: Report to execute not found or failed: PageReportDetail ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at GrapeCity.ActiveReports.Viewer.Win.Rdlx.RdlxDocumentModel.<>c__DisplayClass3.#rNZ(String ext)
    at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
    at GrapeCity.ActiveReports.Viewer.Win.Rdlx.RdlxDocumentModel.#cxz(String reportName, ResourceLocator resourceLocator)
    at GrapeCity.ActiveReports.Viewer.Win.Rdlx.RdlxDocumentModel.#BM0(IDrillthrough drillthrough, IErrorHandler errorHandler)
    --- End of inner exception stack trace ---
  • Replied 26 March 2020, 4:51 pm EST


    You can try after placing both reports in the same folder.
    Please refer the following link to achieve the drill-through feature:

    Also, please refer to the attached report to implement the same.

  • Replied 27 March 2020, 3:58 am EST

    Yes, I've gotten it to work when the report files are "deployed" as files on the disk and loaded like this:
    Dim fi As New System.IO.FileInfo(FilePath & "AR_Reports\Reports\PageReportTest.rdlx")
    Dim repDef As New GrapeCity.ActiveReports.PageReport(fi)
    Dim runt As New GrapeCity.ActiveReports.Document.PageDocument(repDef)

    What I would like to do, is have the report files as Embedded Resources in the DLL, and loaded like this:
    Dim ReportStream As System.IO.Stream = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("Reports.PageReportTest.rdlx")
    Dim tr As New System.IO.StreamReader(ReportStream)
    Dim repDef As New GrapeCity.ActiveReports.PageReport(tr)
    Dim runt As New GrapeCity.ActiveReports.Document.PageDocument(repDef)

    The above code works to display the primary report, but as soon as I click the control to display the drill-down report then I get an exception. Is there an event that I can catch to redirect it to load the embedded resource?
  • Replied 29 March 2020, 4:30 pm EST


    You can use the custom resource locator to achieve your requirements. Please refer to the following link:

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels