Hi,
I have to somehow show report in AngularJS application. Report is loaded on server side in ASP.NET application, in controller with code like this:
public IActionResult test_report()
{
var report = new StiReport();
report.Load(StiNetCoreHelper.MapPath(this, "Reports/test_report.mrt"));
return StiNetCoreViewer.GetReportResult(this, report);
}
How can I show this report in AngularJS page?
I have tried to send a view, from above controller a view is:
@Html.StiNetCoreViewer("StiMvcViewer1", new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = Model,
ViewerEvent = "ViewerEvent",
DesignReport = "Design"
},
Appearance =
{
BackgroundColor = System.Drawing.Color.FromArgb(0xe8, 0xe8, 0xe8),
ScrollbarsMode = true
},
Toolbar =
{
DisplayMode = StiToolbarDisplayMode.Separated,
ShowDesignButton = false
},
Width = Unit.Percentage(100),
Height = Unit.Percentage(100)
})
So, I tried to return this view to AngularJS application and show output HTML, but nothing shows on page.
We cannot connect to database from client JavaScript. Any idea how to load a report on server side ASP.NET and show it in Angular application?
Thanks,
ASP.NET + AngularJS
-
- Posts: 7341
- Joined: Tue Mar 20, 2018 5:34 am
Re: ASP.NET + AngularJS
Hello,
You can render your report on the server side and then send rendered document on the client.
In this case, on the client, you should use the loadDocument() method to load already rendered report to the viewer.
Thank you.
You can render your report on the server side and then send rendered document on the client.
In this case, on the client, you should use the loadDocument() method to load already rendered report to the viewer.
Thank you.
Re: ASP.NET + AngularJS
Hi Lech,Lech Kulikowski wrote: You can render your report on the server side and then send rendered document on the client.
In this case, on the client, you should use the loadDocument() method to load already rendered report to the viewer.
Thank you for you your answer.
Any idea how to "render" document on server side, and load it with loadDocument() on the client (is that some JavaScript component)? I couldn't find an article on site about this issue.
-
- Posts: 7341
- Joined: Tue Mar 20, 2018 5:34 am
Re: ASP.NET + AngularJS
Hello,
On the server side (ASP.NET) you can render report and save it, something like:
StiReport report = new StiReport();
report.Load(reportPath);
report.RegData(data);
report.Render(false);
report.SaveDocument();
and then send this rendered report on the client side for the viewer where use loadDocument() method for loading rendered report.
Thank you.
On the server side (ASP.NET) you can render report and save it, something like:
StiReport report = new StiReport();
report.Load(reportPath);
report.RegData(data);
report.Render(false);
report.SaveDocument();
and then send this rendered report on the client side for the viewer where use loadDocument() method for loading rendered report.
Thank you.