Page 1 of 1

Use Stimulsoft for reporting data in Asp.net core

Posted: Tue Sep 12, 2017 5:48 am
by modl990
when i was work with Windows Form Application C# .For reporting use Stimulsoft and use this code for showing view report data.

Code: Select all

StiReport rpt2 = new StiReport();
rpt2.Load(Application.StartupPath + "\\RPT\\RPTListPoorsantNamayandeh.mrt");

rpt2.Compile();
rpt2["namayandeh"] = comboPoorsantNamayandeh.Text;
rpt2["StTarikh"] = StTarikh;
rpt2["EnTarikh"] = EnTarikh;
rpt2["tarikhGozaresh"] = tarikhGozaresh;
rpt2["GozareshCode"] = GozareshCode;
rpt2.RegData(dtRPTPoorsant);
rpt2.Render();
rpt2.Show();
the above code is true and now i'm working with Asp.net core , for reporting data i want use Stimulsoft.In the example below show reporting file but i don't no how can i send DataSet or DataTable or Models to mrt file

Controller :

Code: Select all

 public IActionResult GetReport()
        {          
            string reportString = System.IO.File.ReadAllText(_hostEnvironment.WebRootPath + "\\Reoprt\\ParametersSelectingCountry.mrt");
            return StiNetCoreViewer.GetReportResult(this, reportString);
        }

        public IActionResult ViewerEvent()
        {
            return StiNetCoreViewer.ViewerEventResult(this);
        }
index.chstml

Code: Select all

@using Stimulsoft.Report.NetCore
@Html.Stimulsoft().StiNetCoreViewer("NetCoreViewver1",new StiNetCoreViewerOptions()
{
    Actions =
    {
        GetReport = "GetReport",
        ViewerEvent = "ViewerEvent"
    }
})

Re: Use Stimulsoft for reporting data in Asp.net core

Posted: Tue Sep 12, 2017 2:12 pm
by Alex K.
Hello,

The components of NET Core are based on the JS engine, all reports are generated and exported on the client side using JavaScript. The server part is used only to manage the report and data files. At the current moment, on the server side, you can only load reports (as a JSON or an XML file), send to report a set of parameters, and also manage the loading of report data. All other actions with the report are performed using NET Core HTML5 designer and NET Core HTML5 viewer.

To provide data, use the GetReportData event, in which you can send the required JSON or XML data to the report engine. Also in this event, it is possible to manage SQL data sources (change connection string, SQL query, or provide your data collection).

You can find samples:
https://github.com/stimulsoft/Samples-NET.Core-CSharp

Sample with data manage:
https://github.com/stimulsoft/Samples-N ... in-Reports

Thank you.