Skip to Content
author's profile photo Former Member
Former Member

Error in Java in replaceConnection when report contains sql expression fields

We are using the crystal java runtime in order to print reports. We connect to an oracle DB. As we want to support different installations, we need to change the schema name (and other connection details) using databaseController.replaceConnection() and databaseController.setTableLocation(). This works perfectly fine for most reports.

Unfortunately, when the report contains sql expression fields, when calling databaseController.replaceConnection() we get the following error. Is there any way to work around this?

(Note: The german error message "Fehler beim Parsen des Ausdrucks." means "Error when parsing expression").

Caused by: Fehler beim Parsen des Ausdrucks.---- 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$

at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)


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.werum.pasx.infrastructure.printing.printtechnology.crystal.AbstractCrystalReportsPrintTechnology.setConnection(

at com.werum.pasx.infrastructure.printing.printtechnology.crystal.AbstractCrystalReportsPrintTechnology.setDatabaseToReport(

... 27 more

Caused by: com.crystaldecisions.reports.reportdefinition.ReportDefinitionException: Fehler beim Parsen des Ausdrucks.



at com.businessobjects.reports.sdk.requesthandler.FormulaRequestHandler.a(SourceFile:159)


at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

... 47 more

Caused by: com.crystaldecisions.reports.common.QueryEngineException: Fehler beim Parsen des Ausdrucks.

at com.crystaldecisions.reports.queryengine.Connection.if(SourceFile:1203)



... 51 more

Caused by: com.businessobjects.reports.jdbinterface.common.DBException: Fehler beim Parsen des Ausdrucks.

at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCQueryDefinition.ParseExpression(Unknown Source)

at com.crystaldecisions.reports.queryengine.Connection.if(SourceFile:1199)

... 53 more

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 01, 2014 at 02:38 PM

    Moved to Java SDK forum

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 01, 2014 at 06:17 PM

    Hi Norbert

    I am not sure what version of CR you are using - but you always want to be using the latest one. See: where applying the later patch resolved that error.

    So getting to the latest SP for your version will be the 1st thing to do.

    And for now, one more thing to keep in mind:

    1217871 - What is the intended use of 'SQL Expression Fields' in Crystal Reports?

    - Ludek

    Senior Support Engineer AGS Product Support, Global Support Center Canada

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Don Williams

      Hi Don.

      I've spent way too much time on this issue already and we have a workaround, so I'm ready to give up.

      On the chance that its a trivial problem, here's the code we use for replacing the connection:

      IConnectionInfo newConnectionInfo = new ConnectionInfo();

      PropertyBag propertyBag = new PropertyBag();

      propertyBag.put("Trusted_Connection", "b(false)");

      propertyBag.put(PropertyBagHelper.CONNINFO_SERVER_TYPE, "JDBC (JNDI)");

      propertyBag.put(PropertyBagHelper.CONNINFO_JDBC_DATABASECLASSNAME, "foo");

      propertyBag.put(PropertyBagHelper.CONNINFO_JDBC_CONNECTION_URL, "foo");

      propertyBag.put("Use JDBC", "true");

      propertyBag.put(PropertyBagHelper.CONNINFO_URI, "foo");

      propertyBag.put(PropertyBagHelper.CONNINFO_DATABASE_DLL, "foo");





      int replaceParams = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;

      databaseController.replaceConnection(oldConnectionInfo, newConnectionInfo, null, replaceParams);

      Tables tables = databaseController.getDatabase().getTables();

      for (int i = 0; i < tables.size(); i++) {

      ITable table = tables.getTable(i);


      databaseController.setTableLocation(tables.getTable(i), table);


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.