隨筆-0  評論-3  文章-28  trackbacks-0
          一. 完全傻瓜式
          1. 將一個指向查看器標記庫描述符文件的引用添加到 JSP 頁面的頂部。 同時必須確保相應的 JAR 文件和附加支持文件都存在。

            <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>注意:    可以為 prefix 屬性指定任何名稱。prefix 確定要使用什么標記前綴來訪問標記庫的標記。

          2. 創建一個開始 viewer 標記。 在此標記中,指定查看器名稱和報表源的類型。

            <crviewer:viewer viewerName="CrystalViewer" reportSourceType="reportingComponent" >

          3. 創建必需的 report 標記。

            此標記指定要顯示的報表以及要用于緩存報表源的會話變量。

            <crviewer:report reportName="/reports/sample.rpt"/>

          4. 結束 viewer 標記。 JSP 頁面現在即可查看名為 sample.rpt 的報表。

                        </crviewer:viewer>

          二. 自定義報表源式

                 1.    將一個指向查看器標記庫描述符文件的引用添加到 JSP 頁面的頂部。 同時必須確保相應的 JAR 文件和附加支持文件都存在。

                    <%@ import="com.crystaldecisions.reports.sdk.ReportClientDocument">

                    <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>

                   注意:    可以為 prefix 屬性指定任何名稱。prefix 確定要使用什么標記前綴來訪問標記庫的標記。

                  2.   創建報表源,設置報表源的屬性,把報表源緩存于session變量中(必需的)

                      <%
                           final String reportName="rpt/Sample.rpt";
                           ReportClientDocument crDoc = new ReportClientDocument();
                           crDoc.open(reportName,0);
                           crDoc.getDatabaseController().logon("sa","");
                           session.setAttribute("reportSource",crDoc.getReportSource());
                     %>

                     注意:如果viewer標記的reportSourceVar屬性的默認值是crystalReportSource,如果用這個做session變量的名稱,那可以不用設置reportSourceVar。

                 3.    創建一個開始 viewer 標記。 在此標記中,指定查看器名稱和報表源的類型。

                       <crviewer:viewer viewerName="CrystalViewer" reportSourceType="pageServer" reportSourceVar="reportSource">

                  4.   結束 viewer 標記。 JSP 頁面現在即可查看名為 Sample的報表。

                      </crviewer:viewer>

          posted on 2008-03-28 16:49 閱讀(341) 評論(0)  編輯  收藏 所屬分類: java基礎
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          文章分類

          Eclipse網址

          java相關網址

          其它

          日語

          英語

          鏈接

          搜索

          •  

          最新評論

          主站蜘蛛池模板: 东丰县| 莱西市| 陵川县| 龙南县| 杭锦旗| 舟曲县| 抚远县| 昌江| 新乡市| 同心县| 多伦县| 含山县| 临颍县| 开平市| 南宁市| 阳江市| 东方市| 鄱阳县| 临邑县| 连云港市| 邻水| 南丹县| 梁山县| 南靖县| 南涧| 越西县| 洪湖市| 赤峰市| 隆子县| 泗水县| 太保市| 中方县| 洮南市| 永胜县| 肥乡县| 乐陵市| 江陵县| 汉川市| 新宁县| 丹寨县| 本溪市|