Crystal Report with jsp

Please help .............................
<html>
<head><title>Table Linking Sample</title></head>
<body>
<%@ page import= "java.net.*" %>
<%@ page import= "java.util.Locale" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.lib.Strings" %>
<%@ page import= " com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.data.* " %>
<%@ page import= "com.crystaldecisions.report.web.viewer.CrystalReportViewer" %>
<%
//Create a report document object
ReportClientDocument rptDoc = new ReportClientDocument();
//assume RAS service is running on the same machine as RAS SDK -
//and attach this report to the local machine
InetAddress ip = InetAddress.getLocalHost();
rptDoc.setReportAppServer(ip.getHostName ());
//instead of opening an existing .rpt, create a new empty report
rptDoc.newDocument();
//Create two table objects
Table tblA = new Table();
Table tblB = new Table();
//Create a connection info object and property bag for the connection
ConnectionInfo ci = new ConnectionInfo();
PropertyBag pb = new PropertyBag();
//place all of the database connection information into the property bag
pb.put(PropertyBagHelper.CONNINFO_DATABASE_DLL, "crdb_odbc.dll");
pb.put(PropertyBagHelper.CONNINFO_DATABASE_NAME , "jstud.mdb");
pb.put(PropertyBagHelper.CONNINFO_SERVER_NAME, "localhost");
pb.put(PropertyBagHelper.CONNINFO_SERVER_TYPE, "ODBC (RDO)");
//attach the property bag to the connection info object
ci.setAttributes(pb);
ci.setUserName("");
ci.setPassword("");
ci.setKind(ConnectionInfoKind.SQL);
//set the names of the tables to be added
tblA.setName("Customer");
tblB.setName("Orders");
//attach the tables to the connection info object
tblA.setConnectionInfo(ci);
tblB.setConnectionInfo(ci);
//Use the Database Controller to add the two tables to the report
rptDoc.getDatabaseController().addTable(tblA, null);
rptDoc.getDatabaseController().addTable(tblB, null);
//retrieve the two tables back from the report document
IDatabase db = rptDoc.getDatabase();
Tables tables = db.getTables();
int tableAindex = tables.findByAlias("Customer");
int tableBindex = tables.findByAlias("Orders");
ITable tableAobj = tables.getTable(tableAindex);
ITable tableBobj = tables.getTable(tableBindex);
//retrieve the fields from each table,
//these fields will be needed for linking
Fields fieldsA = tableAobj.getDataFields();
Fields fieldsB = tableBobj.getDataFields();
//Create a new table link object and two strings (arrays of string)
TableLink tblLink = new TableLink();
Strings sourceFields = new Strings();
Strings targetFields = new Strings();
//Create a single link between tableA and tableB:
//which linked the customer ID field from Customer Table...
sourceFields.add("Customer ID");
//... to the Customer ID field of the Orders Table.
targetFields.add("Customer ID");
tblLink.setJoinType(TableJoinType.leftOuterJoin);
tblLink.setSourceTableAlias("Customer");
tblLink.setSourceFieldNames(sourceFields);
tblLink.setTargetTableAlias("Orders");
tblLink.setTargetFieldNames(targetFields);
rptDoc.getDatabaseController().addTableLink(tblLink);
//Find and add the Customer Name field from the customer table to the report's details section
int fieldIndex = fieldsA.find("Customer Name", FieldDisplayNameType.fieldName, Locale.CANADA );
IField fieldobjA = fieldsA.getField(fieldIndex);
//Find and add the Order ID field from the Orders table
fieldIndex = fieldsB.find("Order ID", FieldDisplayNameType.fieldName, Locale.CANADA);
IField fieldobjB = fieldsB.getField (fieldIndex);
rptDoc.getDataDefController().getResultFieldController().add(-1, fieldobjA);
rptDoc.getDataDefController().getResultFieldController().add(-1, fieldobjB);
Good coding practice would place the following code in its own page.
The above code would re-direct to that page, first storing
the reportSource in a session variable
//Create a viewer to preview the report with
CrystalReportViewer tc1 = new CrystalReportViewer();
tc1.setName("m_Crystal_Report_Viewer");
tc1.setOwnPage(true);
tc1.setEnableDrillDown (true);
//Pass the report to the viewer, and view the report
IReportSource reportSource = rptDoc.getReportSource();
tc1.setReportSource(reportSource);
tc1.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
%>
</body>
</html>
while i am executing i am getting a exception like.............
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. com.crystaldecisions.sdk.occa.report.application.ReportClientDocument resolves to a package
An error occurred at line: 16 in the jsp file: /Crystal.jsp
Generated servlet error:
ReportClientDocument cannot be resolved or is not a type
An error occurred at line: 16 in the jsp file: /Crystal.jsp
Generated servlet error:
ReportClientDocument cannot be resolved or is not a type
please help...............

Kindly assist me where i can find the these <%@ page import= "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.lib.Strings" %>
<%@ page import= " com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%@ page import= "com.crystaldecisions.sdk.occa.report.data.* " %>
<%@ page import= "com.crystaldecisions.report.web.viewer.CrystalReportViewer" %>
packages?

Similar Messages

  • Integrating Crystal Report with JSP

    Could any one send me a sample code how to integrate crystal Report
    with JSP. If so it will be a grade help for my project work.
    Thanks Rasika

    The best place to pick up sample code is straight from the horses mouth. [url http://www.businessobjects.com/products/dev_zone/java/default.asp?ref=devzone_main] Crystal java zone

  • Crystal Reports with JSP

    I am very new to JSP. Currently, I am required to build some graphical reports using Crystal Reports 9, and then display them using JSP.
    I downloaded code samples from some previous posts, but I always get this error:
    An error occurred at line: 1 in the jsp file: /CR-Test/SimpleReport.jsp
    Generated servlet error:
    CrystalEnterprise cannot be resolved or is not a type
    An error occurred at line: 1 in the jsp file: /CR-Test/SimpleReport.jsp
    Generated servlet error:
    IInfoStore cannot be resolved or is not a type
    An error occurred at line: 1 in the jsp file: /CR-Test/SimpleReport.jsp
    Generated servlet error:
    IInfoObjects cannot be resolved or is not a type
    An error occurred at line: 1 in the jsp file: /CR-Test/SimpleReport.jsp
    Generated servlet error:
    ReportClientDocument cannot be resolved or is not a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    I don't know what is the reason of the error? Do I need to install something more on my machine. Currently, I have Crystal Reports 9, and Apache Tomcat 5.5.9 installed. Do I need to install some more components from Crystal Reports or from Java

    Read the Crystal Reports docs

  • Safari Browser issue on Mac with crystal report viewer JSP

    Safari Browser issue with crystal report viewer JSP
    This is my configuration:
    Operating System : Mac X
    Browser : Safari Browser 3.1.4
    Crystal Report : XII Release 2
    Application Server : Jboss 4.2.0
    I am using the following code to view the crystal report in jsp.
    <%@ page import="com.crystaldecisions.report.web.viewer.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.ReportClientDocument" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    CrystalReportViewer theViewer = null;
    ReportClientDocument document = null;
    IReportSource reportSource = null;
    theViewer = new CrystalReportViewer();
    reportSource = document.getReportSource();
    reportSource.refresh();
    theViewer.setReportSource(reportSource);
    theViewer.setOwnPage(true);
    theViewer.setHasExportButton(true);
    theViewer.setHasPrintButton(true);
    theViewer.setHasRefreshButton(true);
    theViewer.setHasLogo(false);
    theViewer.setEnableParameterPrompt(true);
    theViewer.refresh();
    theViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    theViewer.dispose();This code is working fine when the browser is IE or Firefox on Mac X.
    But it is giving me error message when the browser is Safari on Mac X.
    If there is no parameter in the report then the error message is:
    Null Totaller
    If there is parameter in the report then the error message is:
    Parameter prompting is not supported
    Please Help.
    Thanks
    Edited by: VINCEJOHNSON on Jul 30, 2008 7:11 AM

    I am having this exact same issue, only on an ASP.NET page. I can print the report, but it does not display at all.

  • Crystal report from JSP using the JRC

    Hi, I am trying to call crystal report from JSP using the JRC.
    But i am getting the Error as 'Logon Failed'. my web.xml entry is
    <env-entry>
    <env-entry-name>jdbc/Test</env-entry-name>
    <env-entry-value>!oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:{userid}/{password}@//10.0.0.1:1521/TestDB</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    i am setting the userid and password in the code. Please see the below code for your reference. Please help me to solve the issue.
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSource" %>
    <html>
    <head>
    <title>Crystal Report with Database Logon information</title> </head>
    <body bgcolor="#ffffff">
    <%
    try
    String report = "/TEMPLATE.rpt";
    IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
    JPEReportSource reportSource = (JPEReportSource) rptSrcFactory.createReportSource(report, request.getLocale());
    CrystalReportViewer viewer = new CrystalReportViewer();
    viewer.setReportSource(reportSource);
    viewer.setHasRefreshButton(true);
    IConnectionInfo newConnInfo = new ConnectionInfo();
    newConnInfo.setUserName("TEST");
    newConnInfo.setPassword("TEST");
    ConnectionInfos newConnInfos = new ConnectionInfos();
    newConnInfos.add(newConnInfo);
    viewer.setDatabaseLogonInfos(newConnInfos);
    viewer.setEnableLogonPrompt(false);
    viewer.setOwnPage(true);
    viewer.setOwnForm(true);
    out.println("Connection Information: "+viewer.getDatabaseLogonInfos().getConnectionInfo(0).getAttributes().toString());
    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),null);
    viewer.dispose();
    catch(Exception e)
    throw new JspException( e);
    %>
    </body>
    </html>

    I never really had much luck with this approach.
    Mind you I was using Crystal Reports 10, and as far as I recall it didn't allow setting/changing of database at this level.
    Things to check
    - can you create a database connection on your page with this URL/username/password?
    - what server are you using? Tomcat? WebLogic?
    I found this in your other post:
    Connection Information: {Server Name=ee6rpt, Connection String=DSN=s(ee6rpt);User ID=s(ee62test);Password=;UseDSNProperties=b(false), Database Name=, Database DLL=crdb_odbc.dll}That would indicate it is using odbc to connect to the database (crdb_odbc.dll). ODBC is a bad idea with java.
    The way I have got it to work for me (after much trial and error) was to in Crystal Reports to connect using the Oracle Driver, and specifying a tnsname - eg define REPORT_DS in tnsnames.ora.
    When running through the JRC, it looked for a JNDI datasource under that same name "REPORT_DS".
    Don't know if that will help you or not.
    Good luck,
    evnafets

  • Crystal report in JSP using activeX viewer

    Hi,I'm trying to integrate JSP and crystal report.
    can you give me a sample code to display crystal report in JSP using activeX viewer(not pure HTML)
    I'm using crystal report 9,there are ASP sample come with CR9,but no JSP.also I don't want use Crystal Enterprise9 even I know the URL reporting may be the eaier way.

    Hi,I'm trying to integrate JSP and crystal report.
    can you give me a sample code to display crystal
    report in JSP using activeX viewer(not pure HTML)
    I'm using crystal report 9,there are ASP sample come
    with CR9,but no JSP.also I don't want use Crystal
    Enterprise9 even I know the URL reporting may be the
    eaier way.Hi, did u manage to get the ActiveX Viewer up with JSP? I'm also trying to do the same thing. If you could, pls kindly email me the basic source codes to [email protected]? Thanks

  • Error in switching from one database location  to another database location in Crystal Reports using JSP

    Hi,
    Please help me in resolving the issue while changing the database dynamically in crystal reports using JSP. I followed the below link to change DB connection dynamically.
    CRJava Modify DB Location
    Please help me on this.
    While switching from one database to another i found the issue.
    dbController.replaceConnection(oldConnectionInfo, newConnectionInfo,pFields,replaceParams);
    The Error is:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Subreport does not exist.---- Error code:-2147467259 Error code name:failed
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2284)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:732)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)
        at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:480)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:421)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)
        at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
        at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
        at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.char(SourceFile:220)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.new(SourceFile:240)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.do(SourceFile:452)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.if(SourceFile:429)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:156)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
        at com.crystaldecisions.sdk.occa.report.application.an.a(SourceFile:65)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.a(SourceFile:1921)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValues(SourceFile:2237)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValue(SourceFile:2328)
        at org.apache.jsp.DynamicDB_jsp._jspService(DynamicDB_jsp.java:255)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.reportdefinition.ReportModificationException: Subreport does not exist.
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.a(SourceFile:229)
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.for(SourceFile:214)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1492)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)
        ... 47 more
    Any help Appreciated.
    Thanks
    Penchal

    Do you have subreports in your reports?
    If yes, set the connection info for the subreports as well.
    Additionaly refer to the below discussion
    http://scn.sap.com/thread/3153289
    As you are using Crystal reports for ecllipse runtime libraries to build your jsp, you would need to post your dicussions in the below forum to get better response.
    http://scn.sap.com/community/crystal-reports-for-eclipse
    The above space is dedicated for the issues with crystal reports for ecllipse.
    Thanks,
    Prithvi

  • JRC bug: apostrophe in string parameter passed to Crystal Report with Command datasource to SQL Server

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.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.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.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.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.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.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.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.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

  • How to call the crystal report in jsp page

    dear friends
    i want to run or call the crystal report in jsp page.
    if u know that can u send sample code for that to my id
    [email protected]

    Hi Sudhakar,
    Could you please be more speicific about the task you want to accomplish?
    Cheers
    Giri :-)

  • Link to a crystal report with prompt from xcelsius dashboard

    Hi
    How can we make a link to a crystal reports with a country promt?
    If I named the prompt ContryParam in Crystal.
    And I want to open this crystal report by sending f.eks UK as countryname to this report.
    What will the link be seeing as in xcelsius?
    How will the connection be made from xcelsius to this spesific crystal report`?
    BR
    Sadaf

    Hey Sadaf,
    This example uses prompt# to pass "CA" as a value to the first parameter:
    http://<servername>:<port>/CrystalRe
    ports/viewrpt.cwr?id=1152&prompt0=CA
    search for follwing document title for further reading
    Viewing Reports and Documents using URLs

  • Crystal Report with text(csv) data file, can we set it as input parameter?

    Hi,
    I am a new user of Crystal Reports 2008.
    I have created a report with charts in it. The input data comes from a csv text file.
    Can I set the name of this text file as an input parameter?
    as I need to generate 44 similar reports with different text filenames(and data)?
    Thank you.
    Regards

    Brian,
    Thanks much.
    I did exactly what you said.
    Just to see any change, I first gave a bad report file name just to see if I am accidentally pointing to a different file,
    but I got an error saying report not found.
    Then I renamed my original datafile name and generated a report and it still generated one without giving an error.
    Then I also gave a junk name to the logoninfo and printed that name, the new name was assigned to logoninfo, but the code did not error out.
    It ended up generating the report.
    Now here is what I think is happening,
    1) The save data in report option seems to be still on even though I have turned it off in 2 locations
    a) file -> Report Options
    b) file -> Options -> Reporting tab.
    2) For some reason the logoninfo is getting ignored as well.
    Since I did not see any answers yesterday I posted a link to this thread on the .Net forum
    Crystal Report with text(csv) data file, can we set it as input param? C#
    and Ludek Uher says that I am connecting to the text file via a DAO database engine and so need to use the same code for changing the text file as for changing an Access database.
    But the link he gave me tells me to try the same thing that we have been trying..
    Here is my plan,
    1) I will first try and find out why my save data with report option is still on ( but it shows off in Crystal ).
    2) why is LogonInfo getting ignored.
    Meanwhile any suggestions from anyone are welcome.

  • Crystal Report with text(csv) data file, can we set it as input param? C#

    Hi,
    I am new to the forums and posted a question which belonged to the .net - SAP Crystal reports group.
    Can someone help me with my problem? following is the thread that I have started.
    Crystal Report with text(csv) data file, can we set it as input parameter?
    Thank you in advance.

    Looking at the original thread, you are connecting to the text file via the DAO database engine:
    "I added the text file as follow, new connection -> Access/Excell (DAO) -> select the file and the database type as text"
    Thus I would use the same code for changing the text file as for changing an Access database. See Kbase [1218178 - Error: "Logon failed" when connecting to Access database in .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333133373338%7D.do] for more information. If that does not work, you may want to consider connecting via ODBC or feeding the data from the text file to and ADO .NET dataset and pointing the report at the dataset.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Crystal report with prompts takes very long time to open in infoview BOXI3.

    Crystal report with prompts takes very long time to open in infoview BOXI3.1?
    Is there any way to increase the performance.

    Ramsudhakar,
    There are several items that could cause these slow down problems. Without knowing more about the way your environment is setup, I could cause more problems, by giving out performance tips. You would need to be more specific in your post.
    What we know. BOXI3.1
    What we don't know.
    O/S
    App. Server
    Hardware Spec's
    ETC.
    I see that this post has been out here for some time. So if this is still a problem for you I'll try and help, if you provide more information.
    Thanks
    Bill

  • Getting Error while integrating Crystal reports with Java

    Hi All,
    I am getting below error while integrating crystal report with java
    [java] os.arch = x86
    [java] java.lang.NoSuchMethodError: com.crystaldecisions.Utilities.d.<init>
    (Ljava/awt/Image;I)V
    [java] at com.crystaldecisions.Utilities.af.try(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.a(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.<init>(Unknown Source)
    [java] at com.businessobjects.crystalreports.viewer.applet.g.a(Unknown
    Source)
    [java] at com.crystaldecisions.ReportViewer.ReportViewer.start(Unknown
    Source)
    [java] at ReportViewerFrame.<init>(ReportViewerFrame.java:51)
    [java] at JRCViewReport.launchApplication(JRCViewReport.java:29)
    [java] at JRCViewReport$1.run(JRCViewReport.java:50)
    [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
    178)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
    spatchThread.java:190)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
    atchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:138)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:130)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    Any help can be appreciated
    Kalyan

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • Crystal reports and JSP

    Hi there, I would like to call crystal reports from JSP. How can I do that?
    My system is:
    Webserver: iPlanet 4.0 SP4
    Crystal reports: 8.5 Developer version
    Database: Oracle 8i version 8.1.6
    S.O.: Solaris.
    I tried the documentation from Seagate but there isn't examples and explanations in how to do this.
    Do I need some component? Where can I get it, if I do?
    Thankyou,
    Gines

    Please visit:
    www.geocities.com/pmk16
    Regards,
    pmk16

Maybe you are looking for