Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

I am using CRJavaHelper to display report on web but it's not accessing alias of table.

I believe settablelocation is breaking the link so i need to use replaceconnection method instead

Can any help me with demo replaceconnection method code instead of my below current code.

try {

        String reportName = "test.rpt";

       

       

       

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

        if (clientDoc == null) {

            // Report can be opened from the relative location specified in the CRConfig.xml, or the report location

            // tag can be removed to open the reports as Java resources or using an absolute path

            // (absolute path not recommended for Web applications).

            clientDoc = new ReportClientDocument();

            clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);

            // Open report

            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);

           

           

           

            // ****** BEGIN SET RUNTIME DATABASE CREDENTIALS ****************

            {

                String connectStr = PropertyLoader.getProperty("DBURL");

                String JNDIName = PropertyLoader.getProperty("DB_POOL_NAME");

                String driverName = PropertyLoader.getProperty("DBDRIVER");

                String userName = PropertyLoader.getProperty("DBUSER");    // TODO: Fill in database user

                String password = PropertyLoader.getProperty("DBPASSWD");    // TODO: Fill in valid password

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

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

                // logon to database

                CRJavaHelper.logonDataSource(clientDoc, userName, password);

            }

          

Thanks in Advance.

Vish

1 Comment