翻譯|使用教程|編輯:王香|2018-11-05 11:47:45.000|閱讀 417 次
概述:此示例項(xiàng)目演示了如何在ASPX頁(yè)面上添加帶滾動(dòng)條的HTML5 Web查看器。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
默認(rèn)情況下,查看器將其自身大小調(diào)整為報(bào)表的大小。如果要顯示具有指定寬度和高度的查看器,則可能存在查看報(bào)表的整個(gè)頁(yè)面或頁(yè)面的問(wèn)題。為此,它是一種帶滾動(dòng)條的特殊模式。
要添加帶有滾動(dòng)條的Web查看器,只需設(shè)置查看器組件的寬度和高度,并將特殊的ScrollbarsMode屬性設(shè)置為T(mén)rue即可。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web_Viewer_with_Scroll_Bars.Default" %> <%@ Register assembly="Stimulsoft.Report.Web" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %> <!DOCTYPE html> <html> <head runat="server"> <title>Web Viewer with Scroll Bars</title> </head> <body> <form id="form1" runat="server"> <cc1:StiWebViewer ID="StiWebViewer1" runat="server" Width="800px" Height="500px" ScrollbarsMode="true" OnGetReport="StiWebViewer1_GetReport" /> </form> </body> </html>
要顯示報(bào)表,您應(yīng)添加OnGetReport事件,您需要在該事件中加載報(bào)表,并在需要時(shí)注冊(cè)數(shù)據(jù)。
protected void StiWebViewer1_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é)果如下圖所示:
購(gòu)買(mǎi)Stimulsoft正版授權(quán),請(qǐng)點(diǎn)擊“”喲!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn