翻譯|使用教程|編輯:王香|2018-10-29 10:07:11.000|閱讀 356 次
概述:此示例項(xiàng)目演示了如何在ASPX頁面上添加Flash查看器并顯示簡單報表。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
此示例項(xiàng)目演示了如何在ASPX頁面上添加Flash查看器并顯示簡單報表。要添加Flash查看器,只需從Stimulsoft.Report.Web庫中添加StiWebViewerFx組件即可。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Show_Report_in_the_ViewerFx.Default" %> <%@ Register assembly="Stimulsoft.Report.Web" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %> <!DOCTYPE html> <html xmlns="//www.w3.org/1999/xhtml"> <head runat="server"> <title>Show Report in the ViewerFx</title> </head> <body> <form id="form1" runat="server"> <cc1:StiWebViewerFx ID="StiWebViewerFx1" runat="server" Width="100%" Height="800px" OnGetReport="StiWebViewerFx1_GetReport" /> </form> </body> </html>
要顯示報表,您應(yīng)該添加OnGetReport事件,您需要在該事件中加載報表,并在需要時注冊數(shù)據(jù)。
protected void StiWebViewerFx1_GetReport(object sender, Stimulsoft.Report.Web.StiReportDataEventArgs e) { string reportPath = Server.MapPath("Reports/SimpleList.mrt"); StiReport report = new StiReport(); report.Load(reportPath); string dataPath = Server.MapPath("Data/Demo.xml"); DataSet data = new DataSet(); data.ReadXml(dataPath); report.RegData(data); e.Report = report; }
示例代碼的結(jié)果如下圖所示:
購買Stimulsoft正版授權(quán),請點(diǎn)擊“”喲!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn