2019独角兽企业重金招聘Python工程师标准>>>
【下载Stimulsoft Reports.Net最新版本】
此示例项目演示了如何使用组件属性自定义Flash查看器。您可以更改查看器元素的颜色,隐藏隐藏不必要的按钮或菜单项,设置控件的默认状态,更改Flash查看器的某些行为。 例如,设置flash查看器控件的默认宽度和heihgt,显示和隐藏工具栏上的一些按钮,设置单击“退出”按钮时将使用的URL地址,隐藏一些报表导出,设置其他文本。关于对话框:
<%&#64; Page Language&#61;"C#" AutoEventWireup&#61;"true" CodeBehind&#61;"Default.aspx.cs" Inherits&#61;"Customize_the_ViewerFx.Default" %>
<%&#64; Register assembly&#61;"Stimulsoft.Report.Web" namespace&#61;"Stimulsoft.Report.Web" tagprefix&#61;"cc1" %>
要显示报表&#xff0c;您应添加OnGetReport事件&#xff0c;您需要在该事件中加载报表模板文件&#xff0c;并在需要时注册数据。
protected void Page_Load(object sender, EventArgs e)
{}protected void StiWebViewerFx1_GetReport(object sender, Stimulsoft.Report.Web.StiReportDataEventArgs e)
{string reportPath &#61; Server.MapPath("Reports/SimpleList.mrt");StiReport report &#61; new StiReport();report.Load(reportPath);string dataPath &#61; Server.MapPath("Data/Demo.xml");DataSet data &#61; new DataSet();data.ReadXml(dataPath);report.RegData(data);e.Report &#61; report;
}
示例代码的结果如下图所示&#xff1a;
查看原文&#xff0c;下载示例