PDA

View Full Version : سوال: مشاهده گزارش بصورت Pdf



Iran58
یک شنبه 26 تیر 1401, 16:10 عصر
سلام
من کد زیر را نوشته ام و گزارش هم به درستی کار میکند


public IActionResult ShowPrint()
{
return View();
}


public IActionResult Print()
{
var list = dbContect.SexRepository.List();
var report = new Stimulsoft.Report.StiReport();
report.Load("wwwroot/print/Report.mrt");
report.RegData("dt", list);
return StiNetCoreViewer.GetReportResult(this, report);
}


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





@using Stimulsoft.Report.Mvc
@{
ViewData["Title"] = "ShowPrint";
}






@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "Print",
ViewerEvent = "ViewerEvent",


}
})




باید چه کد بنویسم که خروجی بصورت pdf به کاربر نمایش داده شود
برنامه mvc.core (.net5)و استیمول 2020.2.1 است

fakhravari
یک شنبه 26 تیر 1401, 19:04 عصر
https://forum.stimulsoft.com/viewtopic.php?t=40304
https://www.stimulsoft.com/en/samples/reports-web/mvc/managing-report-printing-and-exporting

Iran58
دوشنبه 27 تیر 1401, 12:19 عصر
https://forum.stimulsoft.com/viewtopic.php?t=40304
https://www.stimulsoft.com/en/samples/reports-web/mvc/managing-report-printing-and-exporting
سلام
لینکهای بالا مربوط به mvc.net می باشد و کارای در mvc.core ندارند

fakhravari
شنبه 01 مرداد 1401, 21:49 عصر
https://www.stimulsoft.com/en/samples/dashboards-web/netcore/exporting-and-printing-a-dashboard-from-code

Iran58
یک شنبه 30 مرداد 1401, 09:57 صبح
سلام
باتشکر از جوابتان
آیا راهی وجود دارد بصورت مستقیم گزارش را تبدیل به Word کنیم

fakhravari
یک شنبه 30 مرداد 1401, 19:59 عصر
public IActionResult ExportExcel()
{
StiReport report = new StiReport();
return StiNetCoreReportResponse.ResponseAsExcel2007(repor t);
}