IBM Support

PK38654: Error result

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as Permanent restriction.

Error description

  • Using Rational Application Developer 6.0.1.1 iFix003a
    IBM DB2 v8.2 with db2jcc driver
    
    When trying to update a stored procedure datasource location on
    the Crystal Report designer, the following errors are raised:
    Data
    

Local fix

Problem summary

  • The following class will add a stored procedure to a new
    report. You can then open up the report in the CR4E designer
    to finish off the design portions. This code should work as
    is with stored procedures that do not require parameter
    values, or if the parameters accept null values. If your
    stored procedure requires parameter values to be input to
    return the metadata then you can uncomment the parameter
    code and change it to suit your particular stored procedure
    as necessary.
    Of course we recognize this is not an ideal scenario, but at
    least it will get you up and running. Personally, I am
    against Business Objects defining even another option for
    connecting to a data source. i would rather work with the
    WTP/DTP teams to get this supported in their views. I have
    been in touch with the project lead of DTP in the past and
    will reach out to him again to see if there is anything we
    can support him with on this front.
    So here's the code that worked for me (class name is
    AddStoredProcedure). Let me know if you have any questions.
    import java.io.IOException;
    import
    com.crystaldecisions.sdk.occa.report.application.DatabaseCon
    troller;
    import
    com.crystaldecisions.sdk.occa.report.application.ReportClien
    tDocument;
    import
    com.crystaldecisions.sdk.occa.report.application.ReportSaveA
    sOptions;
    import
    com.crystaldecisions.sdk.occa.report.data.ConnectionInfo;
    import
    com.crystaldecisions.sdk.occa.report.data.FieldValueType;
    import
    com.crystaldecisions.sdk.occa.report.data.IConnectionInfo;
    import
    com.crystaldecisions.sdk.occa.report.data.IParameterField;
    import
    com.crystaldecisions.sdk.occa.report.data.ParameterField;
    import
    com.crystaldecisions.sdk.occa.report.data.ParameterFieldDisc
    reteValue;
    import com.crystaldecisions.sdk.occa.report.data.Procedure;
    import com.crystaldecisions.sdk.occa.report.data.TableLinks;
    import com.crystaldecisions.sdk.occa.report.data.Values;
    import com.crystaldecisions.sdk.occa.report.lib.PropertyBag;
    import
    com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper;
    import
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;
    public class AddStoredProcedure {
    /**
    * @param args
    * @throws ReportSDKException
    * @throws IOException
    */
    public static void main(String[] args) throws
    ReportSDKException, IOException {
    // TODO Auto-generated method stub
    ReportClientDocument rptDoc = new ReportClientDocument();
    String ServerName = null;
    String DatabaseName = null;
    String JDBC_URL = null;
    String JDBC_Class = null;
    String UserName = null;
    String Password = null;
    String TableName = null;
    String ParameterName = null;
    String TableAlias = null;
    String TableQualifier = null;
    TableLinks dummyLink = null;
    //change the following properties to suit your needs
    ServerName = "vanql-rus13";
    DatabaseName = "sanity";
    JDBC_URL="jdbc:microsoft:sqlserver://vanql-rus13:1433?q
    uot;;
    JDBC_Class ="com.microsoft.jdbc.sqlserver.SQLServerDriver";
    UserName = "user";
    Password = "password";
    TableName = "prc_decimal15p5s;1";
    TableAlias= "prc_decimal15p5s;1";
    TableQualifier = "qadb.prc_decimal15p5s;1";
    ParameterName = "@prm1_decimal15p5s";
    rptDoc.setReportAppServer("inproc:jrc");
    rptDoc.newDocument();
    PropertyBag attrs = new PropertyBag();
    attrs.put(PropertyBagHelper.CONNINFO_DATABASE_DLL,
    "crdb_jdbc.dll");
    attrs.put(PropertyBagHelper.CONNINFO_SERVER_NAME,
    ServerName);
    attrs.put(PropertyBagHelper.CONNINFO_DATABASE_NAME,
    DatabaseName);
    attrs.put(PropertyBagHelper.CONNINFO_SERVER_TYPE, "JDBC
    (JNDI)");
    attrs.put(PropertyBagHelper.CONNINFO_JDBC_DATABASECLASSNAME,
    JDBC_Class);
    attrs.put(PropertyBagHelper.CONNINFO_JDBC_CONNECTION_URL,
    JDBC_URL);
    IConnectionInfo connInfo = new ConnectionInfo();
    connInfo.setAttributes(attrs);
    connInfo.setUserName(UserName);
    connInfo.setPassword(Password);
    Procedure table = new Procedure ();
    table.setAlias (TableAlias);
    table.setName (TableName);
    table.setQualifiedName (TableQualifier);
    table.setConnectionInfo(connInfo);
    //uncomment the following code if your Stored Proc requires
    parameters
    /*
    IParameterField param = new ParameterField ();
    param.setType(FieldValueType.numberField);
    param.setName(ParameterName);
    param.setDescription("param");
    Values newParamValues = new Values ();
    ParameterFieldDiscreteValue newValue = new
    ParameterFieldDiscreteValue ();
    newValue.setValue (Double.valueOf("1234.567"));
    newParamValues.add (newValue);
    param.setCurrentValues (newParamValues);
    table.getParameters ().add (param);
    */
    //Add the new procedure table to the report
    DatabaseController dbCtr = rptDoc.getDatabaseController();
    dbCtr.addTable(table, dummyLink);
    //if your stored procedure accepts null values and you left
    the parameter code above
    //commented out the Verify Database call will add the
    parameter to the Parameter list
    rptDoc.verifyDatabase();
    //save the report to a local destination. Passing in 1 as
    the last variable will overwrite
    //existing reports, passing in 0 will throw an error if the
    report already exists
    rptDoc.saveAs("storedProc.rpt", "C:/CR4E/Reports", 1);
    System.out.println("Done");
    }
    }
    

Problem conclusion

  • Programmatic solution provided.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PK38654

  • Reported component name

    APP DEV V6 WIN

  • Reported component ID

    5724J1901

  • Reported release

    600

  • Status

    CLOSED PRS

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2007-02-02

  • Closed date

    2007-07-09

  • Last modified date

    2007-07-09

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
19 October 2021