Posted 24 May 2020, 5:28 am EST
I have implemented Wijmo Report viewer and could make that server side renders the Flex report and set the recordset programatically by adding a custom ReportProvider:
app.UseReportProviders().Add("memoryreports", new ReportDataProvider(GetFullRoot("ReportsRoot") + "\\MedicalReports\\TestReport.flxr", "TestReport"));
Then on my ReportProvider class I override the following method to do my magic:
protected override C1DocumentSource CreateDocument(string path, NameValueCollection args)
{
// in this sample, the path is "ReportsRoot/DataSourceInMemory.flxr/Simple List".
var report = new C1FlexReport();
report.Load(ReportPath, ReportName);
UpdateDataSource(report, args); // HERE I SET RECORDSET MANUALLY
return report;
}
Now, I want to do the same for the Wijmo PDF Viewer. I would like to intercept the call so I can generate my PDF on the fly based on the parameters sent from the UI.
In the web example I see that the component sets the filePath to a static PDF:
<wj-pdf-viewer serviceUrl="https://demos.componentone.com/ASPNET/c1webapi/4.5.20193.222/api/pdf"
filePath="PdfRoot/DefaultDocument.pdf"
:viewMode="viewMode" :mouseMode="mouseMode" :fullScreen="fullScreen" :zoomFactor="zoomFactor"
:viewModeChanged="viewModeChanged" :fullScreenChanged="fullScreenChanged" :zoomFactorChanged="zoomFactorChanged">
</wj-pdf-viewer>
What I need is to intercept the call on the API before the PDF is sent back and then manually I can Load a Flex report and export it to PDF server side and then return the PDF path to the viewer.
How can I do this?