翻譯|使用教程|編輯:王香|2018-11-01 10:55:01.000|閱讀 332 次
概述:此示例項目演示了如何在ASPX頁面上添加Flash設計器并編輯報表模板。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
要添加Flash設計器,只需從Stimulsoft.Report.WebDesign 庫添加StiWebDesignerFx組件即可。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Using_the_DesignerFx.Default" %>
<%@ Register assembly="Stimulsoft.Report.WebDesign" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %>
<!DOCTYPE html>
<html xmlns="//www.w3.org/1999/xhtml">
<head runat="server">
<title>Using the DesignerFx</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:StiWebDesignerFx ID="StiWebDesignerFx1" runat="server" />
</div>
</form>
</body>
</html>
要打開報表模板以進行編輯,可以使用Page_Load事件。例如,創建新的報表對象,從文件加載SimpleList.mrt報表模板,從XML文件添加報表數據,并使用Design()方法調用Flash報表設計器。
protected void Page_Load(object sender, EventArgs e)
{
string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);
// Load report
StiReport report = new StiReport();
report.Load(appDirectory + "\\Reports\\SimpleList.mrt");
// Assign data
StiXmlDatabase database = new StiXmlDatabase("Demo",
appDirectory + "\\Data\\Demo.xsd", appDirectory + "\\Data\\Demo.xml");
report.Dictionary.Databases.Add(database);
report.Dictionary.Synchronize();
// Design report
StiWebDesignerFx1.Design(report);
}
示例代碼的結果如下圖所示:

購買Stimulsoft正版授權,請點擊“”喲!
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn