on 07-15-2009 3:28 AM
如题,谢谢。我有两个问题;
1.Jsp中怎样调用显示crystal report2008做好的rpt文件 ?
2.我现在用的是CR developer,要实现我的第一个问题是不是一定要在web sever上装CR Server 2008?
3.谢谢
难道不能通过jsp动态传递参数进行查询吗?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
谢谢啦
下面是我的代码,现在有个问题。
1.当rpt报表执行过预览后,当jsp传过去的参数跟在cr developer上预览时的参数一致时,报表可以显示出数据。
2.当jsp传过去的参数只是稍微有点改变时,则jap显示都没有数据出来,其它正常,不知道怎么回事。
reportClientDocument = new ReportClientDocument();
reportClientDocument.open("D:
Report
crystal report
AdvisorWorkloadReport.rpt", 0);
ParameterFieldController paramFieldController = reportClientDocument.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue("", "ReportType", new String("Period"));
paramFieldController.setCurrentValue("", "Advisors", new String("'CS1_0_101','CS1_0_102'"));
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date dtStart=df2.parse("2009-01-15 10:31:51");
Date dtEnd=df2.parse("2009-07-17 10:31:51");
paramFieldController.setCurrentValue("", "StartDate", dtStart);
paramFieldController.setCurrentValue("", "EndDate", dtEnd);
reportClientDocument.getDatabaseController().logon("gene_dm","Genesys_76");
reportSource = reportClientDocument.getReportSource();
CrystalReportViewer crystalReportViewer = new CrystalReportViewer();
crystalReportViewer.setOwnPage(true);
crystalReportViewer.setOwnForm(true);
crystalReportViewer.setPrintMode(CrPrintMode.ACTIVEX);
crystalReportViewer.setEnableLogonPrompt(false);
crystalReportViewer.setReportSource(reportSource);
crystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
如果参数没传的话是会出来运行报表时的那个自带的报表参数页的。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
谢谢您的帮忙,报表可以找到了,只是当我把所有的报表参数都传过去的时候,报下面错误
Error
Error finding JNDI name(ONSTCTI) ,ONSTCTI是报表连接数据库的实例名,是不是我少了什么配置文件,比如CRconfig.xml。
下面是代码:
reportClientDocument = new ReportClientDocument();
reportClientDocument.open("D:
Report
crystal report
AdvisorWorkloadReport.rpt", 0);
ParameterFieldController paramFieldController = reportClientDocument.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue("", "ReportType", new String("Period"));
paramFieldController.setCurrentValue("", "Advisors", new String("'CS1_0_101','CS1_0_102'"));
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date dtStart=df2.parse("2009-01-15 02:31:51");
Date dtEnd=df2.parse("2009-07-17 02:31:51");
paramFieldController.setCurrentValue("", "StartDate", dtStart);
paramFieldController.setCurrentValue("", "EndDate", dtEnd);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,您好
上面的错误是rpt文件解析出错呢,还是找不到这个文件呢,我试了多种方法都不行
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /Java_CRJ12_Web_View/jrc_view_report.jsp at line 13
10: try{
11: ReportClientDocument reportClientDoc = new ReportClientDocument();
12: String report = "d:
Interactive Parameters.rpt";
13: reportClientDoc.open(report, 0);
14: Object reportSource = reportClientDoc.getReportSource();
15: session.setAttribute("reportSource", reportSource);
16: response.sendRedirect("CrystalReportViewer.jsp");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: java.lang.AbstractMethodError: com.businessobjects.reports.sdk.JRCCommunicationAdapter.setProductLocale(Ljava/util/Locale;)V
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.Java_005fCRJ12_005fWeb_005fView.jrc_005fview_005freport_jsp._jspService(jrc_005fview_005freport_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.AbstractMethodError: com.businessobjects.reports.sdk.JRCCommunicationAdapter.setProductLocale(Ljava/util/Locale;)V
com.crystaldecisions.proxy.remoteagent.z.a(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportAppSession.int(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportAppSession.initialize(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ClientDocument.new(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.new(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Unknown Source)
com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
org.apache.jsp.Java_005fCRJ12_005fWeb_005fView.jrc_005fview_005freport_jsp._jspService(jrc_005fview_005freport_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
谢谢,我已经照你的做了,可是您给我那个XI版本的Sample
//Open report.
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(REPORT_NAME, 0);
//Store the report source in session, will be used by the CrystalReportViewer.
session.setAttribute("reportSource", reportClientDoc.getReportSource());
//Launch CrystalReportViewer page that contains the report viewer.
response.sendRedirect("CrystalReportViewer.jsp");
还是报
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: ONCHJQSVSHPH43LZ00 - Connection refused: connect-- Error code:-2147217387 Error code name:connectServer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
试一下这段代码:
<%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>
<%@page import="com.crystaldecisions.reports.sdk.*" %>
<%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<%@page import="com.crystaldecisions.sdk.occa.report.data.*" %>
<%@ page import="java.io.*" %>
<%@ page contentType="text/html; charset=GB2312" %>
<%@page pageEncoding="UTF-8"%>
try{
ReportClientDocument reportClientDoc = new ReportClientDocument();
String report = "groupChart.rpt";
reportClientDoc.open(report, 0);
Object reportSource = reportClientDoc.getReportSource();
session.setAttribute("reportSource", reportSource);
response.sendRedirect("CrystalReportViewer.jsp");
}
catch(Exception e)
{
e.printStackTrace();
System.out.println(e);
}
那您说的这个ReportClientDocument类具体是在哪个包下的,我这边的只有在rasapp.jar里面才有
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
难怪。。。
在jrcerom.jar里有。
到这里下载CR4E的jar吧,看来CR2008的lib中不提供JRC的lib了。(XI的版本叫JRC,2008版本叫CR4E)
http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/
下载后,把里边的jar拷出来。
在 XI Release 2下可能有com.crystaldecisions.reports.sdk.*;
在report2008下没有这个类,只有com.crystaldecisions.sdk.occa.report.application.ReportClientDocument
唉
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<%@ page import="com.crystaldecisions.sdk.occa.report.application.ReportClientDocument"%>
String reportPath;
Object reportSource;
ReportClientDocument reportClientDocument;
reportPath = request.getParameter("report_path");
reportClientDocument = new ReportClientDocument();
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
/没有上面一句话就会直接连接本机/
reportClientDocument.open(reportPath, OpenReportOptions._openAsReadOnly);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
谢谢啊
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
这句是不是一定要单独装一个ReportAppServer(RAS)服务,那我该装什么版本的软件?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
报错:u201CUnable to connect to the server: ONCHJQSVSHPH43LZ00. - Connection refused: connect-- Error code:-2147217387 Error code name:connectServeru201D
java_crj12_web_view.jsp中的
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
这一句报错ReportClientDocument.inprocConnectionString不能识别;
设置成reportClientDocument.setReportAppServer(u201Cu201D);就报上面的错误
readme中说需要
2. Ensure the CRConfig.xml file deployed with the web app has reportlocation tag
set to ../..
这个文件中是不是就是配置server信息的,是不是一定需要一个Report Server什么的;
谢谢啊
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
谢谢,这个网站上只有crystal report sdk guide下载,哪里有com.crystaldecisions.reports.sdk的jar包下载啊?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Setup an application context on your application server to host a web application. For assistance with setting up and deploying a web application using the Java Reporting Component, refer to this whitepaper:
http://support.businessobjects.com/communityCS/TechnicalPapers/cr_xi_r2_jrc_deployment.pdf
这个u201DJava Reporting Componentu201C,我需要额外安装什么吗?
cr_xi_r2_jrc_deployment.pdf
这个是Xi R2的,我的版本是CR 2008的。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
我看了是针对XI Release 2的啊,我在CR_developer2008中没有找到com.crystaldecisions.report.web.viewer.*嘛
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
先谢了,看看先
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1.参考 https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/10686300-4111-2c10-8aa9-8bb0b261ffe8
2.不需要装CR Server2008.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.