Quantcast
Channel: SCN : Popular Discussions - SAP Crystal Reports, version for Eclipse
Viewing all 893 articles
Browse latest View live

Facing issues in crystal reports while download and on Navigation buttons

$
0
0

Hi,

 

We have brought up the setup for Crystal Report 2011, connected it to SQL 2008 DB and are able to view the reports. But we are facing 2 issues:

 

1. On click of Download button, the URL gets changed to below and we get a blank screen.

http://localhost:9080/CrystalReportViewerHandler

 

2. For reports which have more than 1 page, on click on “Next” button, it’s not proceeding to next page. Instead a pop message is displayed to the user as below:

“The viewer is unable to connect with the CrystalReportViewerServlet that handles asynchronous requests. Please ensure that the Servlet and Servlet-Mapping have been properly declared in the application’s web.xml file”

 

 

We have verified that our entries are proper in web.xml.

 

 

<context-param>

<param-name>crystal_servlet_uri</param-name>

<param-value>/CrystalReportViewerHandler</param-value>

</context-param>

<servlet>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<url-pattern>/CrystalReportViewerHandler</url-pattern>

</servlet-mapping>

 

 

Kindly let us know if anyone has any inputs.


The viewer was unable to find the resources required to render the report.

$
0
0

I look on the previous threads regarding this issue but it didn't really solve my problem. (see below the error)

 

The viewer was unable to find the resources required to render the report.

Please check the following to resolve the issue.

1. Verify that crystalreportviewers/ is accessible to your WebApp and is the correct path to the viewer resources.

2. You may customize this location by altering the crystal_image_uri and crystal_image_use_relative properties in the web.xml.

3. Validate that the file crv.js exists at crystalreportviewers/js/crviewer/crv.js.

 

I'm using eclipse Indigo EE for my development and Tomcat 7 as my application server.

I generated a jsp file to render a report and I don't get any error when I run my jsp file. However, calling this jsp file from a servlet using

       RequestDispatcher view = request.getRequestDispatcher("Report3-viewer.jsp");

       view.forward(request, response);

I will get the error above. Again, while my Tomcat is atill running and i try to call the jsp right on my browser http://localhost:8080/WRMS/Report3-viewer.jsp .... it will work and generate the report.

Here's a snippet about my xml :

  <context-param>

    <param-name>crystal_image_uri</param-name>

    <param-value>/crystalreportviewers</param-value>

  </context-param>

  <context-param>

    <param-name>crystal_image_use_relative</param-name>

    <param-value>webapp</param-value>

  </context-param>

  <servlet>

    <servlet-name>CrystalReportViewerServlet</servlet-name>

    <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

  </servlet>

  <servlet-mapping>

    <servlet-name>CrystalReportViewerServlet</servlet-name>

    <url-pattern>/CrystalReportViewerHandler</url-pattern>

  </servlet-mapping>

  <servlet>

 

 

Hope somebody could give me an idea on how to call this jsp page from a servlet. Thanks

Crystal Reports e-Learning

$
0
0

Dear All,

 

I used SAP Crystal Reports Plugin with Eclipse have gone through few features of it.

 

Now i have got Sap Crystal Reports 2008 XI on my machine. I was looking forward to know

is there any e-Learning course for it so that i can see how we can utilize the maximum of

Crystal Reports.

 

Looking forward to hear.

 

BR,

Prithvi

 

Edited by: prithvisehgal on May 19, 2011 2:45 PM

How to create a report with data using the Crystal Reports for Java SDK

$
0
0

Hi,

 

How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?

 

I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats.  I can create my own report through the following code snippet:

 

ReportClientDocument boReportClientDocument = new ReportClientDocument();

boReportClientDocument.newDocument();

 

However, I cannot find a way to add data elements to the report without specifying an RPT file.  Is this possible?  I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.

 

is there a way to do this through these packages?

com.crystaldecisions.sdk.occa.report.data

com.crystaldecisions.sdk.occa.report.definition

 

Am I forced to create a RPT file for the different table and column structures I have? 

 

Thank you in advance for any insights.

 

Ted Jenney

How to close database connections in Crystal Reports

$
0
0

I am using the following code to connect to database. I can either pass JNDIName or I can provide values for others by leaving JNDI name empty.

 

If i use JNDI name, it will use a connection from the connection pool of App Server (in my case Weblogic), but it is not releasing the connection after use. Connection remains even if I logoff from the application. If i keep my max connections as 15 in weblogic, after clicking the page with crystal report 15 times all will remain active and users will not be able to login to the application.

 

If i use connectionString and others without using JNDI Name, it directly connects to database. So it creates a connection in database server directly without using connection pool of weblogic. If i check weblogic, it shows no connection in use as expected, but if i check database, i can see the no. of connections increasing everytime a user clicks a crystal report page.

When the connection touches the maximum allowed connection in server, every application using the same server goes down

 

How can I close the connection which was created for the viewing the report?

 

 

String reportName = "/reports/BankBalance.rpt";

ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);

 

if (clientDoc == null)

{

         clientDoc = new ReportClientDocument();

         clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);

   

        // Open report

        clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);

 

     {

       String connectString = ""; // jdbc:sybase:Tds:DBSERVERNAME:9812/DBNAME?ServiceName=DBNAME

       String driverName = "";    // com.sybase.jdbc3.jdbc.SybDriver

       String JNDIName = "DS_APP";

       String userName = "";

       String password = "";

 

       // Switch all tables on the main report and sub reports

       CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);

      

     // logon to database

      CRJavaHelper.logonDataSource(clientDoc, userName, password);

 

}

 

// Store the report document in session

session.setAttribute(reportName, clientDoc);

 

}

 

{

               // Create the CrystalReportViewer object

                      CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();

 

     String reportSourceSessionKey = reportName+"ReportSource";

     Object reportSource = session.getAttribute(reportSourceSessionKey);

     if (reportSource == null)

     {

          reportSource = clientDoc.getReportSource();

          session.setAttribute(reportSourceSessionKey, reportSource);

     }

     //     set the reportsource property of the viewer

     crystalReportPageViewer.setReportSource(reportSource);

     crystalReportPageViewer.setHasRefreshButton(true);

     crystalReportPageViewer.setToolPanelViewType(CrToolPanelViewTypeEnum.none);

           

     // Process the report

     crystalReportPageViewer.processHttpRequest(request, response, application, null);

}

Cannot Extract Embedded Font in PDF Report Generated Using Crystal Reports XI

$
0
0

The issue is that sometimes the PDF reports generated by Crystal Report XI are not showing the fonts properly. Arial font is used in the Crystal report template(.rpt file) for field label and data elements. When the report is opened in Adobe Reader, it displays the message - "Cannot extract the embedded font 'AAAAAA+ArialBold'. some characters may not display or print correctly." Other PDF Readers like Foxit show blank spaces instead. I tried to change the font to Courier New, Times New Roman etc but still getting the same message.


The issue is consistent when the application is deployed in Windows server. When deployed in Unix server the issue happens very occasionally. The font files are available and installed in the UNIX box.


Please tell me why this error message is shown and also tell me how to get it fixed.History Report.png

How do I read the properties of an .rpt file

$
0
0

Post Author: darwinfelix

 

CA Forum: JAVA

 

com.crystaldecisions.sdk.occa.report.document.SummaryInfo

1) We are running Crystal Enterprise XI

2) I have the SDK(s) that's shipped with the installation CD

3) I can delelete and publish reports using the API with no problem

4) My worksatation is on WinXP and XI is on Windows Server 2003

 

On my workstation, I have a .rpt file.

If I &#91;Right-click -> Properties -> Summary tab&#93; that .rpt file from

Windows Explorer, I can see who the Author was, the Last modified

date/time, Comments field, Revision number, Application name, etc.

I noticed in the API that I can modify this info using the

com.crystaldecisions.sdk.occa.report.document.SummaryInfo

java object.  Meaning, the API will allow me to obtain these

properties once I have a reference to the

com.crystaldecisions.sdk.occa.report.document.ReportDocument

java object ( by calling rptDoc.getSummaryInfo() ).

 

However, I do not know how to obtain a reference to this (ReportDocument) object.

1) I do not want to publish this .rpt file to the XI server

2) This .rpt has never been published to the XI serever

3) I prefer not to connect to the XI server

4) The .rpt file is on my Workstation (local hard-drive)

5) The SDK(s) are on my Workstation (local hard-drive)

6) I do not have any servers/services running on my Workstation

7) I want to use Java and the XI SDK(s)

8) I don't want to run my code on the XI server

 

Meaning, at the end of the day, my code will look something

like this...

...ReportDocument rptDoc = ...

SummaryInfo summInfo = rptDoc.getSummaryInfo();

String author = summInfo.getAuthor();String comments = summInfo.getComments();...

 

Can someone please point to some documentation, samples, guides, etc.

that I can read through.

 

thanks,

-darwin

 

Report file not found error

$
0
0

We recently upgraded from JBoss 4.2 to JBoss 5.1.  Our Crystal reports were working fine in JBoss 4.2, but we've had several issues in 5.1. 

 

after resolving several issues, I have reached a point where the application iis unable to locate the .rpt file.  See error below.    Here is my configuration:

 

1.  .rpt files in the WEB-INF/classes folder

2.  CRConfig.xml - reportLocation tag is removed.  It is placed under WEB-INF.

3.   My code is as below:

 

private void init() {

          String report = "MyReport.rpt";

          IReportSourceFactory2 rptSrcFactory = (IReportSourceFactory2) new JPEReportSourceFactory();

          try {

               this.reportSource = (IReportSource) rptSrcFactory

                         .createReportSource(report, l);

 

          } catch (ReportSDKException e) {

               log.error(e.getMessage());

               e.printStackTrace();

          }

     }

 

4.  My .ear file has the following files in the lib folder:

antlr-runtime.jar

commons-beanutils.jar

drools-api.jar

drools-compiler.jar

drools-core.jar

janino.jar

core.jar

jboss-el.jar

jboss-seam-remoting.jar

jbpm-jpdl.jar

mvel2.jar

richfaces-api-3.2.2.GA.jar

webreporting-jsf.jar

webreporting.jar

CrystalCommon2.jar

CrystalReportsRuntime.jar

jrcerom.jar

logging.jar

keycodeDecoder.jar

commons-configuration-1.2.jar

commons-lang-2.1.jar

 

 

5.  My .war file has the follwing files in the WEB-INF/lib folder

commons-digester.jar

jboss-seam-debug.jar

jboss-seam-ioc.jar

jboss-seam-ui.jar

jboss-seam-pdf.jar

jboss-seam-excel.jar

jboss-seam-mail.jar

jsf-facelets.jar

richfaces-impl-3.2.2.GA.jar

richfaces-ui-3.2.2.GA.jar

DatabaseConnectors.jar

JDBInterface.jar

QueryBuilder.jar

XMLConnector.jar

com.azalea.ufl.barcode.1.0.jar

commons-collections-3.1.jar

commons-logging.jar

cvom.jar

icu4j.jar

jai_imageio.jar

keycodeDecoder.jar

logging.jar

pfjgraphics.jar

xpp3.jar

mvel2.jar

jxl.jar

jfreechart.jar

jcommon.jar

jboss-el.jar

logging.jar

xpp3.jar

jrcerom.jar

 

 

6.  Error from server.log

 

2011-09-15 19:42:07,139 ERROR [com.businessobjects.reports.sdk.JRCCommunicationAdapter] (http-127.0.0.1-8080-1) The report file was not found

2011-09-15 19:42:07,186 ERROR [edu.cmu.heinz.hcis.view.bean.ReportsBean] (http-127.0.0.1-8080-1) Report file ParameterNew.rpt not found

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1) com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Report file ParameterNew.rpt not found---- Error code:-2147215356 Error code name:fileNotOpened

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.businessobjects.reports.sdk.JRCAdapterSDKException.a(SourceFile:92)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2299)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.businessobjects.reports.sdk.JRCCommunicationAdapter.<init>(SourceFile:275)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.businessobjects.sdk.erom.jrc.a.<init>(SourceFile:43)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.businessobjects.sdk.erom.jrc.ReportAgentFactory.createAgent(SourceFile:46)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.<init>(SourceFile:703)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:662)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:632)

2011-09-15 19:42:07,186 ERROR [STDERR] (http-127.0.0.1-8080-1)      at com.

 

 

Where is the Java Reporting Component looking for the files?

 

Thanks.


"Can't find resource for bundle java.util.PropertyResourceBundle" error

$
0
0

I just upgraded my webapps to use CR4E SP1. Every time I view a report, I get the following error. What am I missing?

 

[2009-05-08 10:49:56,826] ERROR com.crystaldecisions.reports.common Failed to load the resource 'InternalFormatterException' from the bundle java.util.PropertyResourceBundle@d5f6e9.

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key InternalFormatterException

     at java.util.ResourceBundle.getObject(ResourceBundle.java:384)

     at java.util.ResourceBundle.getString(ResourceBundle.java:344)

     at com.crystaldecisions.reports.common.CrystalResources.loadString(Unknown Source)

     at com.crystaldecisions.reports.common.CrystalResources.loadMessage(Unknown Source)

     at com.crystaldecisions.reports.common.CrystalResourcesFactory.getLocalizedMessage(Unknown Source)

     at com.crystaldecisions.reports.common.CrystalException.getLocalizedMessage(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)

     at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)

     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)

     at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)

     at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)

     at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)

     at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)

     at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)

     at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)

     at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

     at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

     at com.crystaldecisions.sdk.occa.report.application.ReportSource.export(Unknown Source)

     at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.export(Unknown Source)

     at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.export(Unknown Source)

     at com.businessobjects.report.web.event.bh.a(Unknown Source)

     at com.businessobjects.report.web.event.o.a(Unknown Source)

     at com.businessobjects.report.web.event.bw.broadcast(Unknown Source)

     at com.businessobjects.report.web.event.am.a(Unknown Source)

     at com.businessobjects.report.web.a.t.if(Unknown Source)

     at com.businessobjects.report.web.e.a(Unknown Source)

     at com.businessobjects.report.web.e.a(Unknown Source)

     at com.businessobjects.report.web.e.a(Unknown Source)

     at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)

     at com.crystaldecisions.report.web.viewer.ReportExportControl.a(Unknown Source)

     at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source)

     at org.apache.jsp.reporting.exporter_jsp._jspService(exporter_jsp.java:248)

     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

     at java.lang.Thread.run(Thread.java:619)

 

Encoding problem while exporting report to PDF

$
0
0

Hi everyone

 

We have a trouble while exporting Crystal Report with Russian or Lithuanian characters to pdf on web. Some of Lithuanian characters are exported as question marks u201C?u201D. The problem is only if  the web project is running on Linux server. On Windows export and printing works fine.

We have tried both WebSphere Application Server 6.1.0.19 and Sun GlassFish v2.1 installed on Ubuntu 9.04.

 

For the testing purpose we have downloaded u201CAll-In-Oneu201D Eclipse installation (u201CEclipse Ganymede 3.4.1 with Crystal Reports for Eclipseu201D) from businessobjects.com (Crystal Reports for Eclipse version is 2.0.2.r678).

We have done the simplest Crystal Reports Web Project and created a new report with some Lithuanian characters (the report doesn't use any external data source). Then using u201CCrystal Reports->Create Report Viewer JSP...u201D wizard we created standard JSP page with Java code snippets to render report. Then we exported this web project as EAR and run it both on Linux and Windows servers. On Windows server export to pdf works fine, but on Linux not. The same problem is with Russian characters.

 

Could anybody help, how to set charset or encoding used while printing and exporting report to pdf?

 

Thanks in advance

 

Edited by: Judzin on Sep 10, 2009 3:09 PM

why opening from java the rpt search for a JNDI when it's setup for a DNS ?

$
0
0

I downloaded CR for eclipse 2.

 

All is 'quite' working froma a java app.

 

i've only a problem with an 'jndi name search error'. I'll try to explain.

 

In the RPT i use a DSN connection to a sql server into a differente machine. When I open directly the rpt, all is working.

 

From java code, i'll open the report, but when i try to export  to pdf iit tell me about an error 'jndi name search error', with the name of the DSN connection i setup.

 

Why? Why opening rpt all is working, but opening from code NOT is working ?

 

What's the difference from two opening methods? Why an .rpt opened from java cannot just open the connection like when opened from cristal report !?

 

*My question is: why opening from java the rpt search for a JNDI when it's setup for a DNS connection ?! *

Cannot pass parameter in JSF

$
0
0

I am writing a JSF page to get user input, and pass that input to Crystal Report (Crystal Report for Eclipse 2.0). I don't know why the parameterFields cannot load my parameter. Please help me!!!

My First page (rptDemo.xhtml):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml"      xmlns:h="http://java.sun.com/jsf/html"      xmlns:f="http://java.sun.com/jsf/core">  <h:head>      <title>Crystal Report Demo</title>  </h:head>  <h:body>  <h1>Crystal Report for Eclipse 2.0 Demo</h1>  <h2>Using JSF 2.0 and JSF 1.2 to generate report</h2>  <h3>This input/select page use JSF 2.0, result page use JSF 1.2 </h3>      <f:view>          <h:form>              <table border="1">                  <tr>                      <td>No parameter passing to report</td>                      <td colspan="2"><h:commandButton value="Show report 1" action="#{reportBean.show1}"/> can show report normally</td>                  </tr>                  <tr>                      <td>Passing parameter to report<br/>(cannot pass parameter)</td>                      <td><h:inputText value="#{reportBean.inputText}"/></td>                      <td><h:commandButton value="Show report 2" action="#{reportBean.show2}"/></td>                  </tr>              </table>          </h:form>      </f:view>  </h:body>  </html>  

My second page (result page) for "Show Report 1 (rpt1.jsp)", this can run successfully:

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>  <%@ taglib uri="http://www.businessobjects.com/jsf/crystalreportsviewers" prefix="bocrv" %>          <head><title>View Report 1</title>  </head>  <body>  <f:view>  <h:form>  <bocrv:reportPageViewer reportSource="#{reportBean.reportSource1}"  />   </h:form>  </f:view>  <body>  </html> 

 

My third page (result page) for "Show Report 2 (rpt2.jsp)", this has error, parameterFields seem cannot load parameter:

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>  <%@ taglib uri="http://www.businessobjects.com/jsf/crystalreportsviewers" prefix="bocrv" %>          <head><title>View Report 2</title>  </head>  <body>  <f:view>  <h:form>  <bocrv:reportPageViewer reportSource="#{reportBean.reportSource2}" allowParameterPrompting="false"  parameterFields="#{reportBean.parameterFields}" />   </h:form>  </f:view>  <body>  </html> 

 

My report bean is:

package crDemo;    
import javax.faces.bean.ManagedBean;    
import com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory;  
import com.crystaldecisions.sdk.occa.report.data.Fields;  
import com.crystaldecisions.sdk.occa.report.data.ParameterField;  
import com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue;  
import com.crystaldecisions.sdk.occa.report.data.Values;  
import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;  
import com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2;    
@ManagedBean  
public class ReportBean {      private Object reportSource1 = null;      private Object reportSource2 = null;      private String inputText = "";      private Fields<ParameterField> parameterFields = new Fields<ParameterField>();            public Object getReportSource1() {          return reportSource1;      }      public void setReportSource1(Object reportSource1) {          this.reportSource1 = reportSource1;      }      public Object getReportSource2() {          return reportSource2;      }      public void setReportSource2(Object reportSource2) {          this.reportSource2 = reportSource2;      }      public String getInputText() {          return inputText;      }      public void setInputText(String inputText) {          this.inputText = inputText;      }      public Fields<ParameterField> getParameterFields() {          return parameterFields;      }      public void setParameterFields(Fields<ParameterField> parameterFields) {          this.parameterFields = parameterFields;      }            public String show1() {          try {          // Instantiate the report object          String reportLocation;          reportLocation = "rpt/demo1.rpt";          IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();                        reportSource1 = rptSrcFactory.createReportSource(reportLocation, java.util.Locale.getDefault() );          } catch (ReportSDKException e) {              // TODO Auto-generated catch block              e.printStackTrace();          }          return "rpt1";      }            public String show2() {          try {          // Instantiate the report object          String reportLocation;          reportLocation = "rpt/demo2.rpt";          IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();          reportSource2 = rptSrcFactory.createReportSource(reportLocation, java.util.Locale.getDefault() );                    // Clear previous parameter          parameterFields.clear();            //Create a ParameterField object for each field that you wish to set.          ParameterField paramFieldOne = new ParameterField();            //You must set the report name. Set the report name to an empty string if your report does not contain a subreport; otherwise, the report name will be the name of the subreport          paramFieldOne.setReportName("");            //Create a Values object and a ParameterFieldDiscreteValue object for each parameter field you wish to set.          //If a ranged value is being set, a ParameterFieldRangeValue object should be used instead of the discrete value object.          Values valueOne = new Values();          ParameterFieldDiscreteValue paramFieldDVOne = new ParameterFieldDiscreteValue();            //----------- Initialize the parameter fields ----------            //Set the name and value for each parameter field that is added.          //Values for parameter fields are represented by a ParameterFieldDiscreteValue or ParameterFieldRangeValue object.          System.out.println("Input parameter = " + inputText);          paramFieldOne.setName("paramOne");  // "paramOne" is parameter name in my Crystal Report file (demo2.rpt)          paramFieldDVOne.setValue(inputText);            //Add the parameter field values to the Values collection object.          valueOne.add(paramFieldDVOne);            //Set the current Values collection for each parameter field.          paramFieldOne.setCurrentValues(valueOne);            //Add each parameter field to the Fields collection.          //The Fields object is now ready to be used with the viewer.          parameterFields.add(paramFieldOne);            } catch (ReportSDKException e) {              // TODO Auto-generated catch block              e.printStackTrace();          }          return "rpt2";      }  
}  

 

Here is runtime result:

https://public.bay.livefilestore.com/y1pigYkVz4Js_QEKhde3sLBYPuh4V2iGWCboJG3omrD6w5vwl1gOWhiMpfMcPFMzfENu7tLBpK-m1wwWb0mTYv7sg/run.png?psid=1

 

After enter some value, and click "Show report 2"

https://public.bay.livefilestore.com/y1pHsxtGjMgSla_sZlihB6Y7xB6kOyhcOMSwND5xgin5qV1sGw85K_SBJUFJUGt_OlOm7F2fwZ1FO_qVA25cxpmFA/Missing.png?psid=1

set destination for scheduled report as folder(managed)?

$
0
0

How do I set the destination for the scheduled report onto a folder in the same reporting server where the report was picked up? I was able to schedule it to an inbox - But I would very much like it to be on the folder in RAS/FRS.

 

I have seen documentation for other destinations FTP/SMTP/Unmanaged disk/Inbox (Managed)/Printer

But I did not find any for Folder(Managed).

Error code:-2147467259 Error code name:failed Java desktop application

Database connection not closed

$
0
0

Hello,

 

Synopsis:

We are seeing an issue where the database connection used by Crystal Reports is not being closed when a report is generated. Eventually, the connection pool is used up and no more reports can be run.

 

Has anyone a work around, are we not specifying something correctly, or can we request a library fix for this issue?

 

Detail:

- We are using Crystal Reports Java Runtime Component (v2.2.218) as a module on JBoss EAP 6.3

- An EJB is used to generate a report and return the PDF to a user.

- Crystal Reports is set up to use JNDI to get a database connection.

- After report is generated and report closed, the connection pool has one less available connection, and 1 used connection

- Report code is something like this:

 

// Open report

ReportClientDocument reportClientDocument = new ReportClientDocument();

reportClientDocument.open(...);

 

// Set some report parameters

...

 

// Export report

reportClientDocument.getPrintOutputController().export(...);

 

// Close report

reportClientDocument.close();

 

- We noticed that the JBoss database connection pool was slowly getting depleted.

- To debug, we enabled the debugging in the cache connection manager in JBoss which will check for DB connections that have not been closed, and will log the offending class that opened the connection (note: it is not recommended to leave this on in production code) (more detail here: https://developer.jboss.org/wiki/DetectingAndClosingLeakedConnectionsInJBoss71 and here: https://access.redhat.com/solutions/17782 )

- Indeed, the connection is opened by Crystal Reports, but not closed:

 

16:09:58.541 INFO [org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager] (EJB default -7)

IJ000100: Closing a connection for you. Please close them yourself: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@466a2070:

java.lang.Throwable: STACKTRACE

at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.registerConnection(CachedConnectionManagerImpl.java:269)       

at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:519)       

at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)

at com.crystalsdecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source) [DatabaseConnectors.jar:12.2.218.2374]

at com.crystalsdecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123) [CrystalReportsRuntime.jar:12.2.218.2374]

at com.crystalsdecisions.reports.queryengine.br.Open(SourceFile:1786) [CrystalReportsRuntime.jar:12.2.218.2374]

(...continued as obfuscated code)

 

- It seems the class opening the connection also has a close() method, however, it is not called by Crystal Reports.

- We tried calling close manually on the DB controller and IConnection, but received an unimplemented exception in both instances (admittedly, they are for internal use, but we are clutching for solutions)

 

DatabaseController dbController = reportClientDocument.getDatabaseController();

Connections connections =  reportClientDocument.getDatabase().getConnections();

dbController .closeConnection(connections.get(0)); // <-- Exception

Connections.get(0).close(); // <-- Exception

 

11:05:07.372 SEVERE [...reportingClass] (EJB default-3) null; com.crystaldecisions.sdk.occa.report.lib.ReportSDKException:

Currently not implemented in the Java Reporting Component ---- Error code:-21472137395 Error code name: serverProgrammingError

 

 

Possible solutions:

1. Fix the Crystal Reports java library to properly close the database connection

2. (Hack) - Allow an existing connection (java.sql.connection) to be passed in that can be manually closed (Others have asked this question, but the discussions remain unanswered, see here: http://scn.sap.com/thread/1851980and here: http://scn.sap.com/thread/1827266 )


com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Unexpected error determining relative path---- Error code:-21472173

$
0
0

I used Export option to create .war file for Crystal web Project with Export source code option ticked, and destination as tomcat/webapps folder.  When I use the url; http://localhost:8181/VantageTestReport/CrystalReport1-viewer.jsp , Iget relative path error. 

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Unexpected error determining relative path---- Error code:-2147217395 Error code name:serverProgrammingError

 

re portruns properly in CR4E IDE with Run to Server option.  I have reomved the reportlocation tag from CRConfig.xml file and moved the CrystalReport1.rpt file from tomcat/webapps/VantageTestReport folder to wEB-Inf/classes folder.

Any other setting required?  Please help, its urgent as i am evaluating CR4E for integration with our product

How to display Display Image?

$
0
0

Hi All,

 

I have a requirement to show the image file from local directory.  Also, I have a file path to find the image from local machine. Can any of you help me how to show the image in report by using the path? Moreover for each row I have a different image name. So I need to show the different image in each row.

CR XI R2 JRC: Error loading database connector (driverImpl.DriverLoader)

$
0
0

Hello!

 

I developed a report with CR XI R2 SP6 Designer that uses native XML.  Everything in the report seems to be fine...in the preview of my report, all data looks correct.

 

When trying to review the report with the JRC thick client ReportViewerBean, I get the following error just as the report is about to be displayed:

 

Error loading database connector.  The class 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader' could not be accessed.

 

I went through about ten or so previous threads about this error, but none of the solutions are working for me.

 

I'm using NetBeans to develop and debug, and I have CrystalDatabaseConnector.jar added to my project libraries, and I can view the class com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader in the NetBeans object browser.

 

Some of the posts I viewed mention a different jar for this DriveLoader class.  Is there something wrong with the version of CrystalDatabaseConnector.jar that I have?  Do I need an updated jar?  Does this jar rely on another jar that might be missing? I've been through the jar list in the CR XI R2 JRC deployment guide pdf, but I just don't see that I'm missing anything.

 

Thanks for any suggestions!

 

Edited by: Joseph Huber on Mar 9, 2010 2:00 AM

Two commands in the report using the same parameter - fail under Java

$
0
0

I have a report that contains 2 SQL commands.

Both of these commands use one parameter X of type Number in their 'WHERE' clause.

When i'm viewing the report in CR 2008, i'm asked for a value of this parameter and all data is filled in the report - OK

 

The problem occurs when the same report is printed through Crystal Java Runtime:

Report is printed without data! - it's empty.

 

What we noticed in the debug information thrown by the Crystal libraries is that parameter value is set only in one of these commands:

 

Original statement 1:

select a.something
from ANM_T a
where a.anmid = {?PARAMETER01Id}

 

Original statement 2:

SELECT * from ANM_T a
WHERE  a.anmid={?PARAMETER01Id}

 

 

OUTCOME of Statement 1:

 

select a.something

from ANM_T a

where a.anmid = 0

 

OUTCOME of Statement 2:

 

SELECT * from ANM_T a

WHERE  a.anmid=9825

 

 

In above example we may see that crystal set the value only in the second statement - first one got 0 - i suspect its some default value.

Parameter in the Java code is set in the right way. In case of using only one statement it works. If we use two separate parameters (whose values are equal ) it also works.

 

// we have also the loop over the parameters
...
ParameterFieldController paramFieldController =                report.getDataDefController().getParameterFieldController();

paramFieldController.setCurrentValue( "", paramName, paramValue );
...

 

What is strange for me is that Crystal Reports enables to use the same parameter in two commands but if you edit one of them you may change the type of this parameter for a command ( for example from Number to String) but the parameter type in the second command remains unchanged ( it's strange because in my opinion it is the same parameter). In the Field Explorer under the Parameter Fields i still see one parameter of type used in the second command.

Setting the dataSource for subReports cause an unexpected connector err

$
0
0

Hallo,

 

my report contains several subreports. main report and subReports have all the same database definition in the .rpt file (java beans connectivity).

 

at runtime i set the datasource for the main report:

 

databaseController.setDataSource(reportRslt,"getQueriesUsers", "getQueriesUsers");

 

reportRslt is a java resultSet.

 

since this reportRslt is exactly the data needed for the subReports i set it as dataSource for the subreport: 

 

subreportController.setDataSource("GeneralModules",reportRslt,"getQueriesUsers","getQueriesUsers")

 

when the report is being generated i get an unexpected database connector exception.

 

if i omit the following code line:

 

subreportController.setDataSource("GeneralModules",reportRslt,"getQueriesUsers","getQueriesUsers")

 

there is no exception and it seems that the subReports get their data by themself.

 

is there a way to set the subReport's datasource at runtime to a resultSet without getting the exception?

 

or maybe is it possible that the reportDocument will internally pass on the datasource from the main report to the subreports?

 

 

Best regards

 

kerenor

Viewing all 893 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>