C# 使用Stimulsoft在Asp.net core中报告数据
当我使用C# 使用Stimulsoft在Asp.net core中报告数据,c#,asp.net-core,stimulsoft,C#,Asp.net Core,Stimulsoft,当我使用Windows窗体应用程序C#进行报告时,请使用此代码显示查看报告数据 StiReport rpt2 = new StiReport(); rpt2.Load(Application.StartupPath + "\\RPT\\RPTListPoorsantNamayandeh.mrt"); rpt2.Compile(); rpt2["namayandeh"] = comboPoorsantNamayandeh.Text; rpt2["StTarikh"] = StTarikh; rp
Windows窗体应用程序C#
进行报告时,请使用此代码显示查看报告数据
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();
上面的代码是正确的,现在我正在使用Asp.net core来报告我想要使用的数据。在下面的示例中显示报告文件,但我不知道如何将数据集、数据表或模型发送到mrt文件
控制器:
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
@using Stimulsoft.Report.NetCore
@Html.Stimulsoft().StiNetCoreViewer("NetCoreViewver1",new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
}
})
- .NET Core 1.x不支持
s或数据表
s。它们将添加到v2.x中数据集
接受RegData
。用于传递列表DataTable
- .NET Core 1.x不支持
s或数据表
s。它们将添加到v2.x中数据集
接受RegData
。用于传递列表DataTable