Use Stimulsoft for reporting data in Asp.net core
Posted: Tue Sep 12, 2017 5:48 am
when i was work with Windows Form Application C# .For reporting use Stimulsoft and use this code for showing view report data.
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 :
index.chstml
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();
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);
}
Code: Select all
@using Stimulsoft.Report.NetCore
@Html.Stimulsoft().StiNetCoreViewer("NetCoreViewver1",new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
}
})