我有一个9角的应用程序,我想打印报告。
1.当用户单击“打印”按钮时,应该使用什么作为报表打印,记录应该来自数据库?
2.我不想使用window.print()
,因为它打印屏幕,我不想这样做,但我也想在加载报表记录时显示预加载器。
作为后端开发,我正在使用.Net核心。
任何帮助都将不胜感激。
发布于 2020-06-28 06:04:06
您必须在后端处理它,在您的backend
上创建一个可以为您完成任务的方法。您可以根据需要使用database
。您可以使用ViewAsPDF
方法。
只需编写所需的代码,就可以相应地使用它。
假设有服务和方法,可以执行与Database
相关的事情
public IActionResult RDPReport()
{
var model = _reportService.GetRDPReport(); //it would fetch stuff from DB and return those things you want to view in your report
var report = new ViewAsPdf("RDPReport")
{
PageMargins = { Left = 5, Bottom = 5, Right = 5, Top = 5 }, // Do as per need
Model = model
};
return report;
}
https://stackoverflow.com/questions/62618761
复制相似问题