Passing SQL to Crystal Reports Server using JAVA

Hi all,
  We are in the process of redoing our Java app and we would like to create SQL query and pass this to Crystal Reports Server to have it generate a report.
  I've looked all over but still could not find any info on it.  Does anyone know how this is done or know where I can find some information on this?
  I've looked at some of the examples from BO but did not find anything relating to what I need to have.
Thanks in advance.
-S.C.-

Hey,
Have a look at https://boc.sdn.sap.com/node/452
There some other great webinars on the left side also.
Hope that helps.
Else if you wanting to run some SQL before loading the report search for something along the lines of:
(But I warn you this is not the correct coding, I have just quickly cut and paste a
few bits from one of my reports but you should get the idea, hopefully,
might have to use your imagination.)
Connection connection = null;
CallableStatement cs;
Class.forName(dbDriverName);
// Create a connection to the database
connection = DriverManager.getConnection(dbConnectionURL, dbUsername, dbPassword);
// Call a procedure with one IN parameter
cs = connection.prepareCall("{ CALL " + str_ProcStatement + "}");
cs.setString(1, str_Param1);

Similar Messages

  • Create crystal report file using JAVA

    Can someone tell me how to a Create crystal report file using JAVA Programming
    I want a very simple example

    Please help me. It's urgent.[http://catb.org/~esr/faqs/smart-questions.html#urgent]
    Be back in an hour or two...

  • How to print a report on crystal report server using webservice call

    Hi,
    I'm looking for web service api calls that help print a report on the crystal report server. Can someone post a snippet of how this is done.
    Thanks,

    Below is a snippet that uses the BusinessObjects Enterprise XI Release 2 version of the BIPlatform Web Services Java Consumer API:
    Sincerely,
    Ted Ueda
    /* Printer name */
    String printerName = "\\\\van-s-prt01\\VAN-P-BEAVERCREEK";
    /* URL to Enterprise Web Services */
    String servicesURL = "http://localhost:8080/dswsbobje/services";
    Session ceSession = null;
    Connection ceConnection = new Connection(new URL(servicesURL + "/session"));
    EnterpriseCredential ceCredential = new EnterpriseCredential();
    ceCredential.setDomain(cmsname);
    ceCredential.setAuthType(authType);
    ceCredential.setLogin(username);
    ceCredential.setPassword(password);
    try {
         ceSession = new Session(ceConnection);
         ceSession.login(ceCredential);
         ceConnection.setURL(new URL(servicesURL + "/biplatform"));
         BIPlatform bip = new BIPlatform(ceConnection, ceSession.getConnectionState());
         GetOptions getOpts =new GetOptions();
         getOpts.setIncludeSecurity(Boolean.FALSE);
         ResponseHolder rh = bip.get(reportPath, getOpts);
         InfoObjects infoObjects = rh.getInfoObjects();
         CrystalReport report = (CrystalReport) infoObjects.getInfoObject(0);
         ReportProcessingInfo processing = report.getPluginProcessingInterface();
        CrystalReportPrinterOptions printerOptions = processing.getReportPrinterOptions();
        printerOptions.setEnabled(Boolean.TRUE);
        printerOptions.setPrinterName(printerName);
         report.setSchedulingInfo(new SchedulingInfo());
         report.getSchedulingInfo().setRightNow(Boolean.TRUE);
         bip.schedule(infoObjects);
    } finally {
         if(ceSession != null)
              ceSession.logout();

  • Using Web Services on the Crystal Report Server XI to return reports

    <p>Hi,</p><p>I&#39;m trying to setup for the first time a Crystal Reports Server XI R2 and put a couple of reports onto the server.  This is so I can access the reports on the crystal reports server using using the crystal web services and finally display the reports in an ASP.NET web application.</p><p>So far I have installed the server, created a couple of reports, put them on the server, and tested to see that I can access the reports using the Central Management Console.  This all works fine and the reports are returned.</p><p> Ok, now for the bit that&#39;s not working.</p><p> I&#39;ve got a C# ASP.NET web application, and I&#39;ve followed a couple of <a href="http://support.businessobjects.com/documentation/product_guides/cr_net/vs_2005/html/crtsktutorialsotherdynamicpulldownwebservicehelpermethod.htm" target="_blank" title="Adding a Helper Method to Access Crystal Reports Web Services">tutorials</a> to give me an idea of what I should be doing to use the Web Services that are provided:  </p><ul><li>ServerFileReportManager.asmx</li><li>ServerFileReportService.asmx </li></ul><p>However, it appears that when I list the child objects on the crystal server:</p><blockquote><font size="2" color="#008080"><font size="1"><em><font size="2"><p><font size="1">serverFileReport = <font color="#0000ff">new</font> <font color="#008080">ServerFileReport</font>();<br /></font><font size="1">serverFileReport.ReportPath = <font color="#800000">""</font>;<br /></font><font size="1"><br />reportManagerRequest = <font color="#0000ff">new</font> <font color="#008080">ReportManagerRequest</font>();<br /></font><font size="1">reportManagerRequest.ExtraData = serverFileReport.GetExtraData();<br /></font><font size="1">reportManagerRequest.ParentUri = serverFileReport.ToUri();<br /></font><font size="2" color="#008080"><font size="1"><em><br />ReportManagerResponse</em></font></font><font size="1"><em> reportManagerResponse = <font color="#0000ff">new</font> <font color="#008080">ReportManagerResponse</font>();<br />reportManagerResponse = serverFileReportManagerProxy.ListChildObjects(reportManagerRequest);</em></font></p></font></em></font></font></blockquote><p><font size="1"><font size="1">I always get a</font> <font size="2"><font size="1"><em>reportManagerResponse.ReportUris</em></font></font></font><font size="1"> with a count of 0.  Now the thing is I know that I have a couple of reports on the Crystal Server, but for some reason they&#39;re not been picked up.   I must be missing something.</font></p><p><font size="1"><font size="1">Does anyone have any ideas??? Please</font>!</font></p><p>Many thanks in advance,<br />Chris</p><p>Current Set-up:</p><ul><li>Crystal Reports Server XI R2 (11.5)</li><li>Virtual Directory of the web services: crystalreportviewers115 </li><ul><li>(Physical Path - C:\Program Files\Business Objects\common\3.5\crystalreportviewers115)</li></ul><li>Development Environment: Visual Studio 2005</li></ul>

    <p>I looks like your mixing technologies here.   You are using <strong>Crystal Report Server</strong> and the <strong>Crystal Report Web Services</strong> that come with Visual Studio.</p><p>I know that this might seem like they are the same product, and the naming does seem confusing but I&#39;ll try and make it easy for you to understand.</p><p><strong>Crystal Reports Server</strong> - This is a managed reporting solution which allows you to distribute your reports via the web.  It has features like scheduling and built in security.</p><p>It appears that you have a handle on what Crytal Report Server is from what you have been able to accomplish those far.  You have created your report and published it to Crystal Report Server and viewed it via the Central Management Console.  Crystal Reports Server has two methods for accessing the reports programatically.</p><p>1. The Enterprise SDK</p><p>2. The Web Services SDK</p><p><a href="/node/353">Check out this white paper that compares these two SDKs </a></p><p><a href="/node/256">This paper describes the Web Services SDK.</a></p><p>In the above paper there is a getting started section which points you to the Developer Library which shows you how to install the web services on your Crytal Reports Server machine.</p><p>Crystal Reports Server does not have the Business Object web services installed by default so I would suggest following the directions in the <a href="http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm">Developer Library.</a></p><p>The directions wont talk about Crystal Reports Server but these are the directions to get the Web Services installed. </p><p>There is another web services technology which you are writing code for which is called <strong>Crystal Report Web Services.  </strong>This technology comes with Visual Studio 2003.  It provides un-managed reports via webservices.  Un-managed means these reports are not published to Crystal Reports Server.</p><p>So basically your problem is that your code is for <strong>Crystal Report Web Services </strong>but you are trying to view reports published to <strong>Crystal Reports Server.</strong>  To take advantage of scheduling and security and web service access I would suggest using Crystal Reports Server and install the Business Objects Platform webservices to access the reports. </p><p>I hope that&#39;s clear.<br /></p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • Install and configure Tomcat post-Crystal Reports Server implementation?

    Scenario - have Crystal Reports Server 2008 V1 already installed using WACS and IIS. Everything runs great.  Want to add in SAP Crystal Dashboard Design. Looking through the documentation for Dashboard Design tells me I need to:
    1. Install SAP BusinessObjects Enterprise or Crystal Reports Server.
    2. Install SAP BusinessObjects Xcelsius Enterprise 2008.
    3. Install Live Office.
    4. Install SAP BusinessObjects Web Services.
    5. Add the Live Office keycode to the Central Management Console
    Made it past 3 and am hung up on 4. According to documentation for Unified Web Services, it looks like I need Tomcat  installed, but Crystal Reports Server doesn't offer an expand installation option.  There also doesn't seem to be any good documentation included with SAP Crystal Dashboard Design on installing web services - if it's required, why isn't it included and where can I find the documentation (assuming it's different than the Unified Web Services Administrator's Guide I found).
    It seems odd that a customer who might want to purchase an add-on for their Crystal Reports Server implementation wouldn't be able to easily add to their product..
    1)  Can I install web services to Crystal Reports Server using just the WACS or is Tomcat required? The admin guide indicates WACS is not supported for apps that use web services, like Live Office. Is that an absolute?
    2)  If Tomcat is required, can I install and configure it for an existing Crystal Reports Server 2008 V1 implementation?
    3)  If i can install Tomcat on a server with an existing Crystal Reports Server 2008 V1 implementation, is there a specific guide to doing so?

    Hi Colin,
    What is the exact version of BO/Crystal Enterprise.
    If it is BOXI R2 then follow below mentioned steps.
    To manually install the ActiveX Viewer on the client computer:
    1. Copy the ActiveXViewer.cab file from the server to the client computer, and extract its contents to a temporary folder.
    2. Move the files Crviewer.dll, Crviewer9.dll, Sviewhlp.dll, and Swebrs.dll to the System32 folder. Keep this folder visible.
    3. On the Start menu, click Run. The Run dialog box appears.
    4. In the Open box, type "regsvr32" and then drag and drop the Crviewer.dll file icon from the System32 folder onto the Run dialog box.
    5 Click OK.
    Repeat steps 3 and 4 for the files Sviewhlp.dll, and Swebrs.dll.
    You may still be prompted by the browser, choose more options and never install to avoid being prompted.  The viewer should work after that.
    Thanks,
    Purna.

  • How to set DbConnections when scheduling a crystal report using Crystal Reports Server Java SDK?

    Post Author: Manjula
    CA Forum: JAVA
    Hi,
    Trying to schedule a report using Crystal Reports Server Java SDK. Want to pass DBConnections from API, though passing DBConnections, the report is not being scheduled and says "Failed to retrieve data from the database.Details:&#91;Database Vendor Code:6550&#93;.
    Would be thankful if someone could answer my point as applicable.
    Here is the code attached.
    ISDKList dbLogons = oReport.getReportLogons();int dbLogonSize = dbLogons.size();
    for(int i=0; i<dbLogonSize; ++i) {
    IReportLogon dbLogon = (IReportLogon)dbLogons.get(i);
    dbLogon.setDatabaseName("DBname");
    dbLogon.setUserName("usrname");
    dbLogon.setPassword("pwd");
    Thanks in advance.

    Post Author: Manjula
    CA Forum: JAVA
    Ted,
    Thank you for your valuable information.
    First, tried scheduling on Central Management Console and then with the java code.It worked fine, but here is another question for you.
    On the Console, a report exists with ServerName and UserName harcoded and when trying to set ServerName and UserName from the java code, its throwing exception. Where as Password is not set on Console, am able to set password from java.
    And DatabaseName is not set on Console (non editable), unable to set the same from java too. Why is it so?
    So, my question is - though ServerName,DatabaseName,UserName,Password exists on the Console report, can't I override those parameters from java?
    Would be greatful if you answer my question and provide me some guidance.
    Thanks in advance.

  • Crystal Reports Server - Sub Reports requesting SQL Log In

    I have a Sales report which has four subreports. The main report has parameters for year and four product groups. The year parameter and one of the product group parameters are passed to each subreport. When I run the report in Crystal Reports only one SQL log in is requested.  When the report is run from Crystal Reports Server the SQL log in for he main report is handled automatically by CR Server but the report then prompts for 4 SQL logins, one for each subreport.  I am not using integrated securirty. How can I prevent the four SQL log ins?

    Hi Tony,
    From the question that you have posted, we would like to know the following things: -
    1. Are the main report and the subreports using the same database connection?
    2. Which type of viewer are you using in Infoview to view the reports?
    3. How many connections do you see in the Database Source under Process Tab in the properties of the report in CMC?
    Usually this issue can be resolved by using ActiveX or Java Viewer in the Enterprise.
    Please try chaning the viewer and let us know if it helps.
    Cheers!

  • RAS Java API Exception on Crystal Reports Server XI R2

    Hi
    We download run the evaluation version of Crystal Reports Server XI R2 SP2.
    Our web application uses RAS Java API to talk to Crystal Reports Server to open unmanaged reports.
            ReportClientDocument lo_ReportClientDoc = new ReportClientDocument(); //*** Cause exception
            ReportAppSession reportAppSession = new ReportAppSession();
            reportAppSession.createService(
              "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument"); //*** Cause exception
            reportAppSession.setReportAppServer(servername);
            reportAppSession.initialize();   //*** Cause exception
            lo_ReportClientDoc.setReportAppServer(reportAppSession.getReportAppServer());
            lo_ReportClientDoc.open(asReportName,OpenReportOptions._openAsReadOnly);
            ReportServerControl control = new ReportServerControl();
            control.setReportSource(lo_ReportClientDoc.getReportSource());
    The lines marked with "//*** Cause exception" above cause the following exceptions, although at the end the reports came up correctly. When we were running Crystal Reports Server XI (Release 1), we did not see this exception. Can you tell what is going wrong? Thanks.
    SystemOut     O org.xml.sax.SAXParseException: File "null" not found.
    +     at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1202)+
    +     at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:499)+
    +     at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:312)+
    +     at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1079)+
    +     at com.crystaldecisions.xml.serialization.XMLObjectSerializer.load(Unknown Source)+
    +     at com.crystaldecisions.proxy.remoteagent.ClientSDKOptions.readClientSDKOptions(Unknown Source)+
    +              at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.b(Unknown Source)+
    +     at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.h(Unknown Source)+
    +     at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.<init>(Unknown Source)+

    Hey did anyone ever answer your question, I have exactly the same problem 4 years later, sigh

  • Crystal Reports server XI release 2 java Integration - Urgent

    Post Author: premnathk.chn
    CA Forum: JAVA
    Hi,
      I am trying to evaluvate Crystal Reports server XI release 2 and i face problems in integrating it with java. can sombody help me out?
    Also when i try to open a report using INFOVIEW i get a cannot open connection error.
    thank & regards,
    Prem

    What problems exactly are you running into?  Are you getting errors?  Also - the infoview error is most likely that the report can't connect to the database - or that the account that the Page or RAS server is running under can't see the database server.  Try running the page server and RAS server under a user account that has domain privileges
    a programmer learning programming from perl is like a chemisty student learning the definition of "exothermic" with dynamite

  • Configuring Crystal Reports Server to use https

    Post Author: singhal
    CA Forum: General
    Hello,
    I have  crystal reports server.  But everytime I run a report with htmlviewerbridge, it connects to http://hostname:8080
    is there anyway of changing the settings so that it connects to https://hostname:8080 or whatever port is necessary for a https connection?
    thanks,

    One of the messages -"The system xxxx can be contacted, but there is no Central Management Server running at port 6400.  (did check the configuration and port number 6400 was there
    another message: Failed to register with the CMS xxxx. Please make sure the CMIS is up and running. Attempting an automatic retry..
    another message was "Failed to recreate the database. Reason: Internal error: An unknown exception has occurred."
    I choose MYSQL in the setup (because I do not have MS SQL server running on this box)
    I want to do a clean uninstall (which I don't think happened,I did it, but some old users seemed to still be there so besides add/remove programs is there more we should physically delete?)
    Thank you, for your help and I did contact support and this is part of what they said:  (2 times)
    "Dear Barbara,
    Thank you for your e-mail.
    We must advise you that effective 07 July, 2008, the way we support volume products has changed. We've used the opportunity of the integration of Business Objects and SAP to rethink support practices in order to deliver a better level of service to more customers.
    Volume products no longer come with any complimentary support. To speak with an engineer regarding these products, you must have a paid support agreement.
    The products covered by this change are:
    Volume Products without Bundled Support
    Crystal Reports
    Crystal Reports Visual Advantage
    Crystal Reports for Visual Studio
    Crystal Reports for Eclipse
    Xcelsius
    Xcelsius Engage ....

  • How do i connect to sql server using java?

    hi ever body
    i need to connect to sql server using java
    what is the driver i will use?
    thanks

    Microsoft make a jdbc driver and it is readily available through MSDN. Here is a link http://msdn2.microsoft.com/en-us/data/aa937724.aspx. Whatever jdbc driver you are looking for, Google it, and if it exists you'll find it in 10 seconds.

  • How to use oracle functions in Crystal Reports XI using Oracle Server

    Hi all,
    Is it possible  to use oracle functions in Crystal Reports XI using Oracle Server as Data Source.
    If i try to use a procedure,i am getting error with message "Invalid Arguement Provided".
    Functions are not visible objects like tables,views and stored procedures.
    The  jdbs driver i m using is oracle.jdbc.driver.OracleDriver.

    I think it is not possible to add functions in crystal directly for any database. You need to use those functions in a stored procedure and add that storedprocedure as a datasource.
    [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233353335333833323333%7D.do]
    regards,
    Raghavendra

  • Multi Pass in Crystal reports server XI R2

    Hi,
    Ex:
    I have a crystal report  which takes country as input parameter. Each country has one responsible person.
    US--- A person
    UK---B person
    INDIA ---C person
    I need to run this report with these three paramters(may increase infuture) and send the exported report to A,B and C as an mail attachment through crystal reports server XI R2.
    I am using Crystal reports designer XI R2 , Crystal reports server XI R2.
    How could I achieve this in crystal reports server.
    Thanks,
    Vijay Kanth

    Vijay,
    These are the step I use... (after the report has been loaded into CRS)
    1) Open CRS and enter through InfoView.
    2) Locate the newly loaded report in the folder tree.
    3) Choose Schedule
    4) Set all of the necessary values to get the 1st iteration of the report to run as required...
    5) Click the Schedule button in the bottom right corner of the scheduling screen.
    6) Find the report in the folder tree again...
    7) You'll notice that a History option has been added below the report name... Click it.
    8) You'll now see the schedule you created in steps 1- 5... Choose Reschedule
    9) Make sure the Create new schedule from existing schedule radio button is selected (this should be the default).
    10) Make the necessary modifications to to the destination and report parameters and again choose Schedule button in the bottom right corner of the scheduling screen.
    Repeat steps 6 - 10 until you have all necessary schedules completed.
    HTH,
    Jason

  • How to use Crystal Report Server with Crystal Reports for Eclipse

    Hi,
    is it possible to use Crystal Reports for Eclipse with the Crystal Report Server
    like i can do it in Crystal Reports.
    For Example open a Report file directly from the server edit and save there.
    Thanks
    Thomas

    Yes, you can use the CR Server product in your Eclipse project.  However, you will need to use the RAS SDK in your project instead of the CR4E SDK. 
    For more information about the RAS SDK, visit the DevLibrary.
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    -MJ

  • Controlling Access to Certain Reports When Using Crystal Reports Server

    Hi,
    I was wondering exactly how security is managed when using Crystal Reports Server?  Do you assign rights to individual reports via user ids in Active Directory?  Or what exactly is used for user authentication?  Is it possible to create local accounts?  Thanks.

    Usually access is controlled by permissions which are set in the CMC (BO web admin tool). You can map 3rd party groups from AD or LDAP and then assign permissions to those groups or set up security with built in enterprise groups as well. You may elect to use any combination of the above. For more complex security models there can use database and row level security built into our meta layers called business views and universes.
    Regards,
    Tim

Maybe you are looking for