StiMvcViewer.GetReportSnapshotResult need to access in SPA

Stimulsoft Reports.WEB discussion
Post Reply
nilesh8600
Posts: 19
Joined: Tue Feb 16, 2016 10:16 am

StiMvcViewer.GetReportSnapshotResult need to access in SPA

Post by nilesh8600 »

Hello StimulSoft,

Is there anyway where we can convert the "Action Result methods StiMvcViewer.GetReportSnapshotResult" or "existing functionality( please see below code snippet )" to access in Angular SPA + web Api without having much changes?

Below is the code snippet we had previously for accessing stimulsoft reports in our mvc application:

@using Stimulsoft.Report.Mvc;
@{
ViewBag.Title = "Stimulsoft Report";
Layout = "~/Views/Shared/_LayoutForStimulSoftReports.cshtml";
}
<div style="width: 100%;">
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
Theme = StiTheme.Office2013,
Actions =
{
GetReportSnapshot = "GetStimulesoftReport",
ViewerEvent = "ViewerEvent",
PrintReport = "PrintReport",
ExportReport = "ExportReport",
},

Toolbar =
{
ShowParametersButton = false ,
PrintDestination = StiPrintDestination.Pdf
},
Server =
{
GlobalReportCache = false
}
} )
</div>
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by HighAley »

Hello.

It's possible to use StiMvcViewer in SPA. But we don't have special guidelines for this.

Sorry, maybe we don't understand your question.
Could you describe it more detailed?

Thank you.
nilesh8600
Posts: 19
Joined: Tue Feb 16, 2016 10:16 am

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by nilesh8600 »

Sure here are the details,

We have an existing application in MVC 5 where we have used the stimulsoft reports and those are working fine. We got an request to change the framework, so we are moving our application to SPA framework ( angular + webApi ) and for this we are thinking to have the Report conversion task to start the conversion with.

Below are my questions:
Q1.Can we access the .mrt files from SPA or do we need to change those template files?
We have large numbers of report templates (.mrt files), we don't want to change those files as it will be a hectic task to get all files changed.

Q2. As we are using the Web api's, how the mvc ActionResults methods (example method GetReportSnapshotResult ) we can access in HTML file ?

Q3. As you said that we can access the stiMvcViewer in SPA, can you please provide a simple example for this?
nilesh8600
Posts: 19
Joined: Tue Feb 16, 2016 10:16 am

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by nilesh8600 »

Also want to notify that the .mrt files in the existing application we have are in xml format. Can we use the same in SPA or do we need to convert it to Json format? If needed to convert, is there any tool for it?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by Jan »

Hello,
Also want to notify that the .mrt files in the existing application we have are in xml format. Can we use the same in SPA or do we need to convert it to Json format? If needed to convert, is there any tool for it?
You don't need converts your reports to the JSON format. You can use it in XML format. All our products supports now both XML and JSON formats. So you can choose any format.

Thank you.
nilesh8600
Posts: 19
Joined: Tue Feb 16, 2016 10:16 am

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by nilesh8600 »

Thanks Jan! I guess that we just need to replace the stiMvcViewer ActionResults methods with the Reports.Js methods as we are replacing that dll. Do we also need to replace the "Stimulsoft.Report (stiReport class) dll" with any "reports.js supportive dll" Or its okay to have it along with the Reports.js?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiMvcViewer.GetReportSnapshotResult need to access in S

Post by HighAley »

Hello.

As a way you could render the reports as you did it before on server.
Then you could pass the rendered report to the JS Viewer on client side.
This just an idea. And we have no sample to you ad this moment.

Thank you.
Post Reply