asp.net-mvc - 快速报告预览 - C# MVC
问题描述
下午好。我有带有参数的报告,在形成报告之前,我想进行预览。如何使用“webReport.Report.ShowPrepared()”?
item = reportDB.SelectFirst(Convert.ToInt64(showID));
reportDB.SelectBinaryFile(ref item);
var r = new FastReport.Report();
r.LoadFromString(Encoding.UTF8.GetString(item.ReportBody));
WebReport webReport = new WebReport();
webReport.Width = Unit.Percentage(100);
webReport.Height = Unit.Percentage(100);
if (1==1)//проверка на рус язык
webReport.LocalizationFile = "~\\Translation\\Russian.frl";
SetUserInfo(ref r);
webReport.AutoWidth = true;
webReport.AutoHeight = true;
webReport.Report =r;
webReport.PrevPage();
ViewBag.WebReport = webReport.GetHtml();
解决方案
根据官方文档,如果您可以使用 Fast 报告,如下所示。首先你需要检查报告是否准备好了,如果准备返回真正的布尔值,你可以调用 showprepared() 方法。
webReport.Load("report1.frl");
webReport.Prepare(true);
webReport.ShowPrepared();
如果您想使用一些模态窗口并需要返回到之前的页面,那么您可以像下面这样使用它。
void ShowPrepared(bool modal,Form owner)
和前面的方法一样。owner 参数确定拥有预览窗口的窗口。
请从这里阅读更多内容以更好地实施它。 官方文档快速报告
推荐阅读
- vis.js-network - 如何获取节点,连接到边缘被删除?
- python - 如何在 cassandra 中声明地图定义类型的列表
- performance - 在 AMD 上写入非零 FBO 附件时,OpenGL 会降低性能
- python - 在 mysql 表中查询动态列名及其在 python 中的值?
- python - 运行需要多个参数并使用 ExitStack 的脚本
- python - 构成熊猫数据框单元格的数组的最大值
- json - 如何解组带有连字符的 json 字符串作为结构的键?
- azure - 如何理解探查器事务详细信息中的 Azure Application Insight 空白
- python - Django:如何将 jinja2 变量注入模板标签然后返回输出
- php - 如何动态加载类列表?