×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

You can think of *.rpt as template. When the RAS serve the report to web browser, *.rpt needs to be rendered as a html page. Winthin your jsp page, you can call RAS Jdk to processhtmlrequest

sample :

rptAppSession = new ReportAppSession();
rptAppSession.initialize();
ReportClientDocument clientDoc =
(ReportClientDocument) rptAppSession.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
clientDoc.open("test.rpt", 0);
CrystalReportViewer theViewer = new CrystalReportViewer();
IReportSource reportSource = clientDoc.getReportSource();
theViewer.setReportSource(reportSource);
DataDefController ddc = clientDoc.getDataDefController();
ParameterFieldController pfc = ddc.getParameterFieldController();
pfc.setCurrentValues("", "Para1", new String[]{"value1"});

theViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 在Crystal report中设计了.rpt,那么Jsp和这个rpt是什么关系?
    • You can think of *.rpt as template. When the RAS serve the report to web browser, *.rpt needs to be rendered as a html page. Winthin your jsp page, you can call RAS Jdk to processhtmlrequest
      sample :

      rptAppSession = new ReportAppSession();
      rptAppSession.initialize();
      ReportClientDocument clientDoc =
      (ReportClientDocument) rptAppSession.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
      clientDoc.open("test.rpt", 0);
      CrystalReportViewer theViewer = new CrystalReportViewer();
      IReportSource reportSource = clientDoc.getReportSource();
      theViewer.setReportSource(reportSource);
      DataDefController ddc = clientDoc.getDataDefController();
      ParameterFieldController pfc = ddc.getParameterFieldController();
      pfc.setCurrentValues("", "Para1", new String[]{"value1"});

      theViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
      • 生成的jsp上,defaultly,有没有那些控件:next page,last page, page of pages...
        • you can optionally chose what to display, as you can see from code inside, you can specify
          theViewer.setHasRefreshButton(true);
          theViewer.setDisplayPage(true);
          theViewer.setDisplayGroupTree(false);
          theViewer.setDisplayToolbar(true);
          theViewer.setHasSearchButton(false);
          theViewer.setHasRefreshButton(false);
          theViewer.setHasPrintButton(true);
          theViewer.setHasExportButton(true);
          theViewer.setHasGotoPageButton(true);
          theViewer.setHasZoomFactorList(false);
          theViewer.setHasViewList(false);
          theViewer.setHasLogo(false);
          theViewer.setEnableDrillDown(false);

          next/prev page button can be set by code. But page of pages need to be done in 'speical fields' in report designer.

          My suggestion is to setup an environment and get hands dirty. You will find the answer in mintues
          • 多谢能否给一个sample,用Html或jsp把rpt 通过activevX 显示在browser里(不是纯HTML).crystal report9不支持URL reporting,又不想用CE9.