This is a migrated thread and some comments may be shown as answers.

Report Created With Standalone Designer Does Not Get Data At Runtime

1 Answer 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 12 Sep 2019, 01:13 AM

We have a .NET Core Web API project.  Our TRDP and TRDX files are located in wwwroot/reports/.

At design time in the Standalone Designer, the reports preview as expected with the correct data.

That SAME report file at runtime does not request the data, the data method is not invoked.

The below method takes the report, processes it, but the data method never gets called by the report processor.  

I've look at the TRDX file and the assembly name, method and parameter is in the correctly.

 

What could possibly cause this?  The controller has access to the data source assembly and can execute the methods, but the report processor method that is in the same controller, does not invoke the data method.

Thank you in advance,

Karl

 private HttpResponseMessage MakePdfResult(ReportSource report)
        {
            var rp = new ReportProcessor();
            var pdf = rp.RenderReport("PDF", report, null);
            var result = new HttpResponseMessage { Content = new ByteArrayContent(pdf.DocumentBytes) };
            result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
            return result;
        }

1 Answer, 1 is accepted

Sort by
0
Karl
Top achievements
Rank 1
answered on 12 Sep 2019, 01:17 PM

Turns out that the RenderReport method is swallowing exceptions and not reporting the same exception that the ReportsController throws when the AssemblyReferences are not correct.

I added an AssemblyReferences section to the appsettings.json file and it worked.

Tags
General Discussions
Asked by
Karl
Top achievements
Rank 1
Answers by
Karl
Top achievements
Rank 1
Share this question
or