Long running reports using java servlets

Hello,
I'm running into a problem using java servlets to produce database reports and sending them back to the client browser as excel or html. The problem comes into play when the user has submitted two reports then goes to run a third and the browser hangs. I realized now that this is because of the two active connections that the user already has to the app server. Does anyone have any suggestions on how to get around this? I'm trying to now write the report to the server, and provide the browser with a url, but it seams as though the connection isn't totally closed even though I close the response printwriter.... Any suggestions would be greatly appreciated....

Unfortunately I dont have an answer to your question, but:
If the reports are large/long running, should they be generated on demand? You could schedule the reports to be generated every day, month or whenever appropriate, stored on the server and then quickly pulled by the user whenever needed.

Similar Messages

  • How do you reference a Formular Object on a Crystal Report using Java

    Hi all,
    I am trying to reference an object on my report which contains a Formula field.
    I have read the following 2 threads, but they refer to textObjects:
    [How do you reference a textObject on a Crystal report using Java|Re: How do you reference a textObject on a Crystal report using Java?]
    [Changing the text of ITextObject programatically|Re: Changing the text of ITextObject programatically]
    But I cannot even get those to work. I can reference a object which refers to a database field but as soon as I try
    reference a textObject or reportObject I just get a NULL variable.
    Below is the code I am useing
    IReportObject dbField = reportClientDocument.getReportDefController().findObjectByName("BOB1");
    IReportObject textBob = reportClientDocument.getReportDefController().findObjectByName("BOB2");
    "BOB1" is the name of my DB field Object, and "BOB2" can be a Text box or a Formula item and I just get nothing.
    I have just tested it with a FieldHeadingObject and that returns a valid object, so clearly I am going about this the wrong way
    for objects I place on the reports which are not driven by the database items.
    Ultimately what I want to do is reference an object in the Report Footer which will contain the RecordCount of the number of
    records contained in the report, which I am them going to use to determine if the report holds data,
    if it does I will print it, else ignore it and move on the the next report. I am doing this so that I can at an extra filter to split
    a report up into groups and produce a sinlge PDF for each group instead of one massive PDF containing all the groups.
    So if someone has a solution to any of my problems I would be very greatful, and I dont mind being told Im an idiot and should
    rather do it another way, as long as you supply that other way
    Thanks for the help
    Darren
    Edited by: Darren Jackson on Dec 16, 2009 7:29 PM
    Forgot to add am using CR4Ev2 SP3

    Right I have made some headway.
    Firstly, Im an idiot. I was making changes and setting up test fields on my report, but then when running the app, I had it looking at
    the backup report, which would explain why all the new textbox fields were not being found.
    The stupiditity did force me to delve deep and work out a fair bit of how the reports work, so cant complain too much. BUT, I am still
    not able to return values of Formula fields and formulas extra. Could someone tell me if this is even possible. I get retrieve the formula field
    name, and properties but not its value once the report has been populated. Am I wasting my time?
    Well I will continue dismantling my reports till I find the answer, or someone points me in the right direction.
    If any one is interested this is the code I used to drill down to my text boxes:
    IReportObject recCount = reportClientDocument.getReportDefController().findObjectByName("TB1");
    ITextObject obj_RecCount = (ITextObject) recCount;
    System.out.println(obj_RecCount.getName());
    Paragraphs objP = obj_RecCount.getParagraphs();
    for (int i = 0; i < objP.size(); i++){
         ParagraphElements pE = objP.getParagraph(i).getParagraphElements();
         for (int j = 0;j < pE.size(); j++){
              IParagraphTextElement pEE = (ParagraphTextElement) pE.getParagraphElement(j);
              System.out.println(pEE.getText());
    Cheers

  • FRM-41214 by long running Report

    Hi,
    Forms/Reports 10g on OC4J:
    I get a Forms error FRM-41214 by trying a long running Report after 14 min,
    Iin the Reports log we find a 'end of connection..' .
    Is there a config parameter of Forms to handle this worst case?
    Many thanks
    Friedhold

    Hi Christian,
    I am using the rp2rro-package (modified) :
         SET_REPORT_OBJECT_PROPERTY(rp2rroNodeId,REPORT_DESFORMAT,rp2rroDesformat);
         SET_REPORT_OBJECT_PROPERTY(rp2rroNodeId,REPORT_SERVER,rp2rroReportServer);
         IF id_null (mparamlist_id)  THEN
          SET_REPORT_OBJECT_PROPERTY(rp2rroNodeId,REPORT_OTHER,rp2rroReportOther);
          rp2rro_jobidFull:=run_report_object(rp2rroNodeId);
         ELSE
           rp2rro_jobidFull:=run_report_object(rp2rroNodeId,mparamlist_id);
         END IF;
    I am trying also the asynchron Reports mode and get the same break (on the same side 1257 from about 2500 sides) ::
    [2013/7/1 0:11:59:282] Info 56013 (ConnectionManager:release): Connection 87771 is released
    [2013/7/1 0:11:59:291] Info 56013 (ConnectionManager:release): Connection 87772 is released
    [2013/7/1 0:11:59:306] Info 56013 (ConnectionManager:release): Connection 87773 is released
    [2013/7/1 0:11:59:316] State 56016 (JobManager:updateJobStatus): Job 1643 status is: Bericht Seite 1257 wird formatiert wird ausgef??hrt
    [2013/7/1 0:11:59:316] Debug 50103 (JobManager:updateJobStatus): Finished updating job: 1643
    [2013/7/1 0:11:59:317] Info 56013 (ConnectionManager:release): Connection 87774 is released
    [2013/7/1 0:11:59:327] Info 56013 (ConnectionManager:release): Connection 87775 is released
    [2013/7/1 0:14:6:923] Info 56013 (ConnectionManager:release): Connection 98871 is released
    [2013/7/1 0:14:6:934] Exception 50125 (org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 208 completed: Maybe
    at com.sun.corba.se.internal.iiop.IIOPConnection.purge_calls(IIOPConnection.java:438)
    at com.sun.corba.se.internal.iiop.ReaderThread.run(ReaderThread.java:70)
    ): Interner Fehler org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 208 completed: Maybe
    [2013/7/1 0:14:6:934] Info 56029 (EngineManager:shutdownEngine): Shutting down engine rwEng-0
    [2013/7/1 0:14:6:935] Exception 50125 (org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:148)
    at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
    at com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
    at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
    at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
    at com.sun.corba.se.internal.corba.ClientDelegate.request(ClientDelegate.java:886)
    at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:431)
    at oracle.reports.engine._EngineClassStub.shutdown(_EngineClassStub.java:173)
    at oracle.reports.server.EngineManager.shutdownEngine(EngineManager.java:1473)
    at oracle.reports.server.JobManager.runJobInEngine(JobManager.java:1033)
    at oracle.reports.server.ExecAsynchJobThread.run(ExecAsynchJobThread.java:54)
    ): Interner Fehler org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    [2013/7/1 0:14:6:935] State 56004 (EngineInfo:setState): Engine rwEng-0 state is: Shutdown
    [2013/7/1 0:14:6:935] Info 56047 (EngineManager:remove): Reports Server shut down engine rwEng-0
    [2013/7/1 0:14:6:936] State 56016 (JobManager:updateJobStatus): Job 1643 status is: Mit Fehler beendet:
    REP-56048: Engine rwEng-0 ausgefallen, job Id: 1643
    Regards
    Friedhold

  • WIJ 20002 error on long running reports

    When trying to run a long running report, an error message is received .
    Quote:
    *"The Web Intelligence Java Report Panel cannot connect to the server. Close
    the report panel and try to connect again or see your BusinessObjects
    administrator. (Error: WIJ 20002)"*
    What happens next is you are advised to "close" (twice) and are then advised to close this window.
    If you select Details on the first error message:
    Server: https://test.i3access.iowa.gov:443/desktoplaunch/InfoView/CrystalEnterprise_Webi/cdzServlet?
    java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 502 for URL: https://test.i3access.iowa.gov:443/desktoplaunch/InfoView/CrystalEnterprise_Webi/cdzServlet
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
         at com.businessobjects.wp.cpi.CPIConnection.postRequest(CPIConnection.java:437)
         at com.businessobjects.wp.xml.XMLViaHttp.loadScript(XMLViaHttp.java:144)
         at com.businessobjects.wp.xml.XMLViaHttp.getPromptList(XMLViaHttp.java:1284)
         at com.businessobjects.wp.xml.XMLLoader.getPromptList(XMLLoader.java:279)
         at com.businessobjects.wp.om.OMQuery.loadPromptsAndContexts(OMQuery.java:359)
         at com.businessobjects.wp.om.OMQuery.getActiveContextCount(OMQuery.java:384)
         at com.businessobjects.wp.tc.query.TCQueryPropertie.buildQueryContextFromUI(TCQueryPropertie.java:496)
         at com.businessobjects.wp.tc.query.TCQueryTab.buildQueryContextFromUI(TCQueryTab.java:846)
         at com.businessobjects.wp.tc.query.TCQueryTab.modifyQueryProperties(TCQueryTab.java:638)
         at com.businessobjects.wp.tc.query.TCQueryTabManager.modifyQueryTabs(TCQueryTabManager.java:306)
         at com.businessobjects.wp.tc.query.TCQueryPanel.modifyQueryTabs(TCQueryPanel.java:310)
         at com.businessobjects.wp.tc.query.TCQueryPanel.load(TCQueryPanel.java:383)
         at com.businessobjects.wp.tc.TCMainPanel.switchToQueryPanel(TCMainPanel.java:563)
         at com.businessobjects.wp.tc.TCMainPanel.actionPerformed(TCMainPanel.java:506)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
         at com.businessobjects.wp.cpi.CPIConnection.postRequest(CPIConnection.java:441)
         at com.businessobjects.wp.xml.XMLViaHttp.loadScript(XMLViaHttp.java:144)
         at com.businessobjects.wp.xml.XMLViaHttp.getPromptList(XMLViaHttp.java:1284)
         at com.businessobjects.wp.xml.XMLLoader.getPromptList(XMLLoader.java:279)
         at com.businessobjects.wp.om.OMQuery.loadPromptsAndContexts(OMQuery.java:359)
         at com.businessobjects.wp.om.OMQuery.getActiveContextCount(OMQuery.java:384)
         at com.businessobjects.wp.tc.query.TCQueryPropertie.buildQueryContextFromUI(TCQueryPropertie.java:496)
         at com.businessobjects.wp.tc.query.TCQueryTab.buildQueryContextFromUI(TCQueryTab.java:846)
         at com.businessobjects.wp.tc.query.TCQueryTab.modifyQueryProperties(TCQueryTab.java:638)
         at com.businessobjects.wp.tc.query.TCQueryTabManager.modifyQueryTabs(TCQueryTabManager.java:306)
         at com.businessobjects.wp.tc.query.TCQueryPanel.modifyQueryTabs(TCQueryPanel.java:310)
         at com.businessobjects.wp.tc.query.TCQueryPanel.load(TCQueryPanel.java:383)
         at com.businessobjects.wp.tc.TCMainPanel.switchToQueryPanel(TCMainPanel.java:563)
         at com.businessobjects.wp.tc.TCMainPanel.actionPerformed(TCMainPanel.java:506)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Please let me know what the solution is.

    Matt,
    A namesake of yours is my client for this issue.
    Coming to the problem, the customer says there is proxy configured between HTTP server and WebSphere. This proxy server times out for long running reports. If the HTTPServer is bypassed, things work fine.
    A colleague of mine opened a case with BOBJ. I can get you the case# if you need it. We got this reply:
    From: Takano, Hitomi
    Sent: Tuesday, November 04, 2008 10:26 AM
    Hi Matt,
    I was away for the last two days, so I couldn't reply to you sooner.
    Extending the timeout setting from Webi and Infoview in BOXI R2 will not
    make the long running reports work as your proxy setting at the lower
    layer than BOXI just allows 5 minutes and after that the connection will
    be cancelled by the proxy. I'm not sure why this setting was effective
    for https only or timeout out after 2 min. This is out of scope of BOXI
    R2 and your network admin would be the best person to handle. You were
    getting 502 error in Java Report Panel. I googled with "502 error and
    ProxyTimeout", and I got the some articles returned which say  when
    backend doesn't answer on requests(because it timed out), it returns to
    a client an error 502.
    I'll close this thread as the n/w admin at the client are working things out.
    Thanks for your support.

  • Web.Show_Document does not work with long running reports

    I am using Web.Show_Document() to call reports from Forms. Everything works fine for smaller reports. However for long running reports I do not get the output instead get the page "This page cannot be displayed.". On checking the job status on the report server I find that report is still running and completes after some time but by that time my http request has already timed out. What configuration do I have to change to make my long running reports work.
    Thanks

    So, looks like this is an IE issue. I need to add the form server site to my list of Trusted Sites. Once I did that, everything started to work fine. Thought I'd share in case anyone is really interested.....

  • Script to kill long running reports in OBIEE

    Hi
    I have requirement to kill long running reports . I am using OBIEE version 10.1.3.4.0 which has a bug where it is not taking query limits governor and the reports are not getting killed if i am setting that parameter in RPD.
    Oracle support has advised me to upgrade to next version, but for now, i cannot upgrade.
    Can anyone suggest me script to run on obiee app server that can kill long running reports on obiee and database server.
    I have AIX server and all reports run on database with same functional ID that is being used for ETL as well to Analytics database.

    Shikhs17 wrote:
    Hi
    I have requirement to kill long running reports . I am using OBIEE version 10.1.3.4.0 which has a bug where it is not taking query limits governor and the reports are not getting killed if i am setting that parameter in RPD.
    Oracle support has advised me to upgrade to next version, but for now, i cannot upgrade.
    Can anyone suggest me script to run on obiee app server that can kill long running reports on obiee and database server.
    I have AIX server and all reports run on database with same functional ID that is being used for ETL as well to Analytics database.Do you want to enforce the limitation on the database to automatically kill running sessions that run over specific period of time?

  • Long Running Reports

    I'm now writing some reports that are slow running. I've tuned the sql, however because the volume of data being returned and the complexity of the report queries the reports will likely never run faster then ~30 seconds.
    I'm using the ApEx advanced reporting (BIP) and ApEx version 3.0.1.
    What are some thoughts on how to best implement long running reports?
    Thanks,
    Todd
    Message was edited by:
    tfa

    Hi Dimitri,
    You asked...
    What happens when you run the report directly from BI
    Publisher?There are several reports from one application. I've run the report queries in OEM SQL Tuning Advisor and tuned them.
    I have not seen a noticeable difference in run times between submitting the reports from APEX or running them from BIP. The queries for these reports have the same run time when run through SQL Developer.
    The slow run time of the report queries can be traced to poor table design. The application is a bit of legacy application with the front end now being rewritten using APEX. The poor table design issues are magnified by the volume of data. I have plans to partition one of the transaction tables.
    Prior to rewriting the user interface in APEX the application was written in Oracle Forms. When written in Forms the application was a bolt-on to the Oracle applications. In that environment users could submit reports to the run in the background (via Concurrent Manger) then the report output was viewed later following the completion of the report.
    I'm pursuing a similar solution as the concurrent manager in Oracle applications but available in the APEX, BIP environment. The reports do run between 30 seconds to 1 minute which is to long for the users to wait on the submitting page. Any thoughts on how it is possible to run these long running reports without tying up the user’s page?
    I'll investigate dbms_scheduler and BIP APIs. I know BIP also has a scheduler available but I do not know much about it.
    Thanks,
    Todd

  • Long running reports end successfully - present s "page can not be found"

    Long running reports and browser timeouts - page can not be found"
    We are launching Oracle 9i Reports from a Portal 9ias (release 9.0.2.2) system. We are in production with about 100 users. It is not going well with respect to Report problems.
    We have the following problems:
    1) hanging reports,
    2) reports where parameter screens will not present due to large LOV on parameter screen,
    3) and the most aggravating problem is "Page can not be found" presented to user when in fact the report ran successfully and create a .pdf.
    We are at our wits end with Oracle Support and the Oracle Portal and Reports product.
    As I said, I am launching Oracle Reports 9i from a Portal 9.0.2.2 application. I have several long running reports that complete successfully but return to the user an error "Page can not be found". Meta-link Note: 189454.1 suggests a modification to ReceiveTimeout parameter in the pc registry. We set the ReceiveTimeout parameter to 7200000. This did not solve the problem. Users still receive "Page can not be found".
    Is there a report server side setting that we must set also ... or some other setting we should check?
    I need to solve this issue. Is there someone out there that can help? Are there other people having similar Oracle Reports issues? According to Oracle Support we are the only people with these issues. Are we?

    1) If you can reproduce the Reports Hanging issue consistently you can push Oracle Support to file a bug.
    2) I am not sure about this now, but again you can take this to Oracle Support and push for resolution.
    3) There are some problems with IE - Adobe integration. This is not a Reports bug. You can try
    (a) Switching off Adobe - web integration in Adobe Acrobat reader settings, so that Adobe will not automatically open pdf file in web. Instead a dialog will be shown as to which application to open the pdf file or save it to disk and user can save the file to disk and open.
    (b) Use IE latest version. (or some other browser like Netscape )
    [ You can roll back the ReceiveTimeout param change you made to see the impacts one at a time ]
    1) To confirm that this is a Adobe - IE pdf problem run the same report to htmlcss, rtf. If these come fine, then we can ascertain that this is Adobe - IE issue.
    2) Give http://host:port/reports/rwservlet/showjobs?server=server_name. You can see all the jobs and their jobids. For the concerned jobs you can click and see whether output is actually generated or not.
    Thanks
    The Oracle Reports Team
    The statements and opinions expressed here are my own and not that of my employer

  • Creating a sample report using JAVA SDK

    Hi,
    I am trying to create a sample report using JAVA SDK.
    I slelect 4 "free cells" and pass 4 different strings to it.
    I even slelect the font colour and size. When i run the class and try to view the report in Infoview, I only seeblank blocks without any data. Now if I edit the report from infoview, and save the changes, I am able to see the data.
    My issue is, Why am I not able to see the data when I run the java code.
    Please find teh code below.
    package com;
    import java.awt.Color;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import com.businessobjects.rebean.wi.BinaryView;
    import com.businessobjects.rebean.wi.DataProvider;
    import com.businessobjects.rebean.wi.DataProviders;
    import com.businessobjects.rebean.wi.DataSource;
    import com.businessobjects.rebean.wi.DataSourceObject;
    import com.businessobjects.rebean.wi.DocumentInstance;
    import com.businessobjects.rebean.wi.DocumentLocaleType;
    import com.businessobjects.rebean.wi.FontImpl;
    import com.businessobjects.rebean.wi.FreeCell;
    import com.businessobjects.rebean.wi.HTMLView;
    import com.businessobjects.rebean.wi.OutputFormatType;
    import com.businessobjects.rebean.wi.PageHeaderFooter;
    import com.businessobjects.rebean.wi.Query;
    import com.businessobjects.rebean.wi.Recordset;
    import com.businessobjects.rebean.wi.Report;
    import com.businessobjects.rebean.wi.ReportBody;
    import com.businessobjects.rebean.wi.ReportCell;
    import com.businessobjects.rebean.wi.ReportContainer;
    import com.businessobjects.rebean.wi.ReportElement;
    import com.businessobjects.rebean.wi.ReportEngine;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.CeKind;
    public class Aug7th {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String CMS = "pundl8136:6400";
              String userID = "srivas";
              String password = "morcom123";
              String auth = "secEnterprise";
              List<String> entire =new ArrayList<String>();
              List<String> country =new ArrayList<String>();
              List<String> resort =new ArrayList<String>();
              IEnterpriseSession enterpriseSession;
              try
                   ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr();
                   enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);
                   if (enterpriseSession != null)
                   {//Create and store useful objects for the session.
                        IInfoStore iStore = (IInfoStore)enterpriseSession.getService("InfoStore");
                        ReportEngine reportEngine = (ReportEngine)enterpriseSession.getService("WebiReportEngine");
                        IInfoObject infoView = null;
                        String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
                        "AND SI_INSTANCE = 'false' AND SI_NAME='Structure Test_001_Java' ORDER BY SI_NAME ASC ";
                        //String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
                        IInfoObjects objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
                        System.out.println(objInfoObjectsWIDs.size());
                        IInfoObject objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
                        DocumentInstance doc = reportEngine.openDocument(objInfoObjectWID.getID());
                        DataProviders dps = doc.getDataProviders();
    //                     Retrieve the 1st data provider
                        DataProvider dp = dps.getItem(0);
    //                     Retrieve the universe objects
                        DataSource ds = dp.getDataSource ();
                        Query q = dp.getQuery();
                        Recordset rs = dp.getResult(0);
    //                     0: assume query has one flow
                        rs.first();
    //                     Print the column types. They can be Integer, String,
    //                     or Date.
                        for (int i = 0; i < rs.getColumnCount(); i++) {
                        Class c = rs.getColumnType(i);
                        StringBuffer sbt = new StringBuffer();
                        if ( c.equals(Integer.class) )
                        sbt.append("Integer");
                        if ( c.equals(String.class) )
                        sbt.append("String");
                        if ( c.equals(Date.class) )
                        sbt.append("Date");
                        sbt.append(";");
                        System.out.println(sbt.toString());
                        System.out.println(rs.getColumnCount());
                        while (!rs.isLast()) {
    //                          column names
                             StringBuffer sbn = new StringBuffer();
                             StringBuffer sbd = new StringBuffer();
                             for (int j = 0; j < rs.getColumnCount(); j++) {
                             sbn.append( rs.getColumnName(j).toString() );
                             sbn.append(";");
                             System.out.println("sbn "+sbn.toString());
    //                          data
                             for (int k= 0; k< rs.getColumnCount(); k++) {
                             sbd.append( rs.getCellObject(k).toString() );
                             sbd.append(";");
                             entire.add(rs.getCellObject(k).toString());
                             System.out.println("sbd "+sbd.toString());
                             rs.next();
                        System.out.println(entire.size());
                        for(int i=0;i<entire.size();i++){
                             country.add(entire.get(i));
                             i++;
                             System.out.println("entireList "+entire.get(i));
                             resort.add(entire.get(i));
                        DataSourceObject city = ds.getClasses().getChildByName("Country");
                        DataSourceObject resorts = ds.getClasses().getChildAt(1);
                        dp.runQuery();
                        ReportContainer report = doc.createReport("Resort");
                        PageHeaderFooter header = report.getPageHeader();
                        FreeCell headerCell = header.createFreeCell("Resort Report");
                        PageHeaderFooter footer = report.getPageFooter();
                        FreeCell footerCell = footer.createFreeCell("Report Ends");
                        ReportBody body =  report.createReportBody();
                        for(int k=0;k<resort.size();k++){
                        FreeCell res=body.createFreeCell(resort.get(k));
                        res.getAttachTo();
                        res.setHeight(15d);
                        res.setWidth(30d);
                        Color c = new Color(255,255,255);
                        Color c1 = new Color(255,0,0);
                        FontImpl fnt = (FontImpl)res.getFont();
                        fnt.getDecoration().setTextColor(c1);
                        res.setFont(fnt);
                        //res.deleteAttachment();
                        //res.setAttachTo(body,VAnchorType.BOTTOM,HAnchorType.NONE);
                        doc.applyFormat();
                        doc.refresh();
                        final String l_docToken = doc.getStorageToken();
                        final DocumentInstance l_docToSave = reportEngine.getDocumentFromStorageToken(l_docToken);
                        doc.saveAs("mor31",835,null,null);
                        doc.closeDocument();
                        str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
                        "AND SI_INSTANCE = 'false' AND SI_NAME='mor31' ORDER BY SI_NAME ASC ";
                        //String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
                        objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
                        System.out.println(objInfoObjectsWIDs.size());
                        objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
                        DocumentInstance doc1 = reportEngine.openDocument(objInfoObjectWID.getID());
                        String token = doc1.getStorageToken();
                        DocumentInstance doc2 = reportEngine.getDocumentFromStorageToken(token);
                        doc2.saveAs("123123", 835, null, null);
                   //     doc.refresh();
                        //doc.save();
                   enterpriseSession.logoff();
              catch(Exception e)
                   e.printStackTrace();

    duplicate post:
    Sample report using JAVA SDK

  • How to run long running report in the background

    Oracle Application server 10g
    I need to run the long running reports in the background because while the report is running the cursor is loading and the control doesn't return to the user
    this feature exist in oracle 6i by set the following parameter
    RUN_PRODUCT( REPORTS, 'r_1', ASYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    How can I accomplish the same in OAS 10g?

    Hi,
    I've done this in 11g. I think it will be the same in 10g as well
    Following are the steps in 11g using run_report_object.
    1. Read metalink note: Using the Reports Server Queue PL/SQL Table and API - RW_SERVER_JOB_QUEUE [ID 72531.1]
    2. Implement RW_SERVER_JOB_QUEUE table as per above notes.
    3. When submitting report run it as background
    a. SET_REPORT_OBJECT_PROPERTY(lo_report_object, REPORT_EXECUTION_MODE, ASYNCHRONOUS); -
    SET_REPORT_OBJECT_PROPERTY(lo_report_object, REPORT_COMM_MODE , BATCH);
    4. Display the job_id to user (notification).
    5. Create a new form to view reports base on on RW_SERVER_JOB_QUEUE which provides you the status, etc.... (you may have to create a way to identify the username who submitted the job. This way not all users will see the jobs in RW_SERVER_JOB_QUEUE )
    6. Optionally you can use NOTIFYSUCCESS=email to notify user when the report is finished.
    Cheers
    LS

  • How to Cancel Long Running Report

    Hello
    I'm looking for a way to cancel the printing of a long running report programatically? I'm using the CrystalDecisions.CrystalReports.Engine.ReportDocument() class.
    Thanks for your help

    Hi Syed,
    The old viewer was COM based and the new viewer is .NET. CR has the ability if the DB server supports Async communication. Most DB's don't so it wasn't of much use. For those that did the functionality was through custom coding within the Designer only. Async would allow CR to send a stop processing command to the DB server. If the server did not have the ability then CR can only wait for the data to start coming back before stopping the viewer from updating.
    In any event I don't believe the Windows Viewer in .NET has the ability but I will suggest it to the Product group to add the ability in some future version.
    Thank you
    Don

  • Probelm Running Report on java

    Hello all,
    i have problem about running report on java lenguage.
    i use ireport for my report and use mysql ver. 4 database.
    i get the link site http://www.cise.ufl.edu/~otopsaka/CIS4301/ReportDemo/ from my friend, so i try to create project myselft.
    i has create ireport file and connect to mysql database and i save my ireport file on directory :
    C:\Documents and Settings\Yusuf Hermanto\My Documents\Study\Java\rpt
    and i give my ireport file name report1.jrxml
    so i create java file for load that file(ireport file), i save my java file on directory like ireport file : C:\Documents and Settings\Yusuf Hermanto\My Documents\Study\Java\rpt and i give my java file name laporan.java
    my java code like this :
    import java.sql.*;
    import net.sf.jasperreports.view.JasperViewer;
    import net.sf.jasperreports.engine.xml.JRXmlLoader;
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.design.JasperDesign;
    import net.sf.jasperreports.engine.JasperReport;
    import java.io.OutputStream;
    public class laporan {
           public laporan(){}
           public static void main(String[] args){
                  try{
                      Class.forName("com.mysql.jdbc.Driver");
                      String url = "jdbc:mysql://localhost/apotik";
                      Connection jdbcConnection = DriverManager.getConnection(url,"root","");
                      System.out.println("Connection Sukses...");
                      JasperDesign jasperDesign = JRXmlLoader.load("report1.jrxml");
                      JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
                      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, jdbcConnection);
                      JasperViewer.viewReport(jasperPrint);
                      System.out.println("sukses report");
                  }catch(Exception e){
                       System.out.println("Gagal :" + e.getMessage());
    }so i complie my java file and sucess.
    and then i [Run[/b] my java file and i fond problem like this :
    Connection Sukses...
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
                        at laporan.main(laporan.java:21)
    Finished executing
    Can you halp me to find the solution about my problem ?
    thanks for all.
    Message was edited by:
    panji_tengkorak

    NoClassDefFoundError: org/apache/commons/digester/DigesterIncorrect classpath or missing library. More probably the latter.

  • Get a Report crashed error while running report using the mode character

    Hello,
    I'am getting an "Enable to run report - Report as crashde" issue only when I'am running reports using the mode character. The same report with desformat pdf never has any problems. I have changed the englife (set to one) increase the cachesize but I still have the same issue.
    I'm using report 6i and Oracle 8i.
    Thanks in advance for your help.
    Regards,
    Laurent.

    Hi Thanks for the response,
    In fact the report in character mode is working fine in my environnement but is not working on my customer environnement (which is supposed to be the same as mine). I was thinking of cache size issue or something like this ?
    Regards,
    Laurent.

  • XML Reading Using Java Servlet

    I need some help in reading xml file using java servlet.
    May i have some sample codes to read xml files?
    I would really appreciate your help. Thanks!!!

    This grabs a url and parses it with a servlet.
    URL befreeUrl = new URL(urlString);
    uri = new URI(urlString);
    URLConnection yc = befreeUrl.openConnection();
    BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    factory.setValidating(true);
    out = new OutputStreamWriter(System.out, "UTF8");
    DefaultHandler handler = new BeFreeRequestSAXParser(); /* custom handler class */;
    parser.parse(uri.toString(), handler);
    in.close();

  • Update database logon in reports using java

    Please review the code below and let me know where did I go wrong! I am able to login to CMS and able to retrieve the list of reports. Now, I am trying to update the database credentials for a single report using java (My requirement is to update all 200 reports though!).
    This is the 100th time I go this error message: Failed to open the connection.report.lib.ReportSDKServerException: Failed to open the connection.
    I also wrote a sample java program which tries to connect to the sql server database with same login credentials - this works perfectly fine. But, if I use the same connection url, driver name and login credentials, this report fails to update for whatever reason. Please help me ASAP..Thanks!
    import com.crystaldecisions.sdk.exception.*;
    import com.crystaldecisions.sdk.framework.*;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.occa.managedreports.*;
    import com.crystaldecisions.sdk.occa.report.application.*;
    import com.crystaldecisions.sdk.occa.report.data.*;
    import com.crystaldecisions.sdk.occa.report.lib.*;
    import java.util.Iterator;
    class ChangeDataSource {
        public static void main(String args[]){
             String cms = "134.X.X.X:6400";
             String username = "Administrator";
             String password = "";
             String auth = "secEnterprise";
             IEnterpriseSession enterpriseSession = null;
             ISessionMgr sessionMgr = null;//CrystalEnterprise.getSessionMgr();   
             Exception failure = null;
             boolean loggedIn = true;
             ReportClientDocument clientDoc = null;
             if (enterpriseSession == null)
              try
                  sessionMgr = CrystalEnterprise.getSessionMgr();
                  enterpriseSession = sessionMgr.logon(username, password, cms, auth);
                  System.out.println("\nLOGIN SUCCESSFUL\n");
              catch (Exception error)
                  loggedIn = false;
                  failure = error;
              if (!loggedIn)
                   System.out.println("\nLOGIN FAILED\n");
              else
                  // Query for the sample report from the Enterprise CMS.
                  try {
                        IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");
                        IInfoObjects infoObjects = iStore.query("Select SI_ID From CI_INFOOBJECTS Where SI_INSTANCE=0 AND SI_PARENT_FOLDER=771");
                        System.out.println("\ninfoObjects size = "+infoObjects.getResultSize());
                        IReportAppFactory reportAppFactory = (IReportAppFactory)enterpriseSession.getService("RASReportFactory");
                        IInfoObject infoObject = (IInfoObject)infoObjects.get(0);      
                        clientDoc = new ReportClientDocument();
                        clientDoc = reportAppFactory.openDocument(infoObject,0, java.util.Locale.US);
                        System.out.println("Report "+ infoObject.getTitle() +" Opened");     
                        switch_tables(clientDoc.getDatabaseController());
                   }catch(ReportSDKException re){                    
                        re.printStackTrace();
                   }catch(SDKException re){
                        re.printStackTrace();
         private static void switch_tables(DatabaseController databaseController) throws ReportSDKException {
              //Declare the new connection properties that report's datasource will be switched to.
              //NOTE: These are specific to using JDBC against a particular MS SQL Server database.  Be sure to use the
              //DisplayConnectionInfo sample to determine what your own connection properties need to be set to.
              final String TABLE_NAME_QUALIFIER = "dbname.dbo.";
              final String DATABASE_NAME = "dbname";
              final String DBUSERNAME = "userid";
              final String DBPASSWORD = "pword";
              final String SERVERNAME = "134.X.X.X";
              final String CONNECTION_URL = "jdbc:sqlserver://134.X.X.X:1433;DatabaseName=dbname";
              final String DATABASE_CLASS_NAME = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
              final String DATABASE_DLL = "crdb_jdbc.dll";
              //Obtain collection of tables from this database controller.
              Tables tables = databaseController.getDatabase().getTables();
              System.out.println("\nTables size = "+tables.size());
              //Set the datasource for all main report tables.
              for (int i = 0; i < tables.size(); i++) {
                   //ITable currTable = tables.getTable(i);     
                   ITable table = tables.getTable(i);
                   //Keep existing name and alias.
                   table.setName(table.getName());
                   table.setAlias(table.getAlias());
                   //System.out.println("Table Name = "+table.getName()+" Alias "+table.getAlias());
                   //Change properties that are different from the original datasource.
                   table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
                   System.out.println(table.getQualifiedName());
                   //Change connection information properties.
                   IConnectionInfo connectionInfo = null;
                   try{
                        connectionInfo = table.getConnectionInfo();
                        //System.out.println("conn info: "+connectionInfo);
                   }catch(Exception re) {
                        re.printStackTrace();
                   //Set new table connection property attributes.
                   PropertyBag propertyBag = new PropertyBag();
                   //Overwrite any existing properties with updated values.
                   propertyBag.put("Trusted_Connection", "false");
                   propertyBag.put("Connection URL", CONNECTION_URL);
                   propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
                   propertyBag.put("Server", SERVERNAME);
                   //propertyBag.put("Database Name", DATABASE_NAME);
                   propertyBag.put("Server Type", "JDBC (JNDI)");
                   //propertyBag.put("URI", null);
                   propertyBag.put("Use JDBC", "true");
                   propertyBag.put("Database DLL", DATABASE_DLL);
                   connectionInfo.setAttributes(propertyBag);
                   System.out.println("\n Properties SET\n");
                   //Set database username and password.
                   //NOTE: Even if these the username and password properties don't change when switching databases, the
                   //database password is *not* saved in the report and must be set at runtime if the database is secured. 
                   connectionInfo.setUserName(DBUSERNAME);
                   connectionInfo.setPassword(DBPASSWORD);
                   connectionInfo.setKind(ConnectionInfoKind.SQL);
                   table.setConnectionInfo(connectionInfo);
                   //Update old table in the report with the new table.
                   try {
                        databaseController.setTableLocation(table, tables.getTable(i));               
                        }catch(ReportSDKException re) {
                        re.printStackTrace();
                   System.out.println("\n All tables updated\n");

    I have exactly same error. I can confirm that CRJavaHelper.changeDataSourceReportClientDocument clientDoc,
                    String reportName, String tableName,
                    String username, String password, String connectionURL,
                    String driverName,String jndiName)
    has very slow performance.
    Obviously the line:
                        clientDoc.getDatabaseController().setTableLocation(origTable, newTable);
    works very slow. I also have JDBC defined in report and also stored procedure, that returns recordset (cursor) in 0.48 sec.
    I am using CR Reports Server XI R2 and custom JAVA client program that renders report to pdf.
    Lines from java program:
    rpt = new ReportClientDocument();
    String report = "C:
    temp
    CrystalReport1.rpt";
    rpt.open(report, com.crystaldecisions.sdk.occa.report.application.OpenReportOptions._openAsReadOnly);
    CRJavaHelper.changeDataSource(rpt, "The specified item was not found.", "", "jdbc:oracle:thin:@oratest:1521:oratest","oracle.jdbc.driver.OracleDriver", "");
    CRJavaHelper.addDiscreteParameterValue(rpt, "", "P_INET_ID", id);
    rpt.refreshReportDocument();
    PDFExportFormatOptions pdfOptions = new PDFExportFormatOptions();
    ExportOptions exportOptions = new ExportOptions();
    exportOptions.setExportFormatType(ReportExportFormat.PDF);
    exportOptions.setFormatOptions(pdfOptions);
    InputStream is = rpt.getPrintOutputController().export(exportOptions);

Maybe you are looking for

  • My Mac Pro keeps restarting & I don't know why

    Hi, It's happened three times now, twice when I was asleep and once when I actually witnessed it happen. When I saw it happen, it was  as if someone had pulled the power plug out of the back, it was that quick.  I was typing along and suddenly zap, i

  • Transfer Customer Master records from one company code to another company.

    hi ,     working on a rollout project , needed to transfer Customer Master records from one company code to another company code. is there any sap standard BDC/T-code as in case of Vendor Master FK15,Fk16(T-CODE) . thanks in advance. rahul Edited by:

  • Flat file as a source - now more confused then before.

    Sorry to open this topic again - i just got confused to what needs to be done (i did read all of the posts on previous topic - honest!) got confused to who did what and how it needs to be done. it's hard to be stupid sometimes :( here is what i have:

  • Imovie hd 6 crashes - Bad Access- libSystem.B.dylib

    imovie HD 6 crashes on start up. I have verified the disk, the permissions and checked the memory to no avail. I even re-installed the software for the application. Pls help. Exception: EXCBADACCESS (0x0001) Codes: KERNPROTECTIONFAILURE (0x0002) at 0

  • WEB DYNPRO ABAP IN NETWEAVER 04

    Hi to all When, in my system, I view System / Status, I view that in component versions appear "Netweaver 04". In this version: I can develop web dynpro for abap ??? Thank you by the information Regards Dario Rodriguez.