How to clear the report from Cache.

Hello all,,,
In my project iam using crystsal report for eclipse to generate reports.
Iam using a .jsp page to call my report.(which i got it from the examples of CRE).
The name of my jsp page is poi.jsp
The name of my Crystal report is Department.rpt
My problem is this....
when i run the report first time i can see my poi.jsp page and user can submit
the parameter and based on the users parameter the report is generated..(ITs working absoultely fine)
but when the user runs the report again, its not showing the parameter page (i.e user cannot see poi.jsp)
rather its showing the old generated report.
When i tried using session.invalidate and session.removeAttribute it was showing me the poi.jsp page
but the problem is when the user clicks on the print icon or any icon on the report its just
showing the poi.jsp page...
When the user closes the report or when the clicks on the button to generate the report it should
show the parameter page (poi.jsp).how can i solve this problem???
the code what i am using is as follows
try {
          String reportName = "C:/workspace/Reports/WebContent/Department.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 connectString = "jdbc:oracle:thin:@192.168.1.4:1521:orcl";
                    String driverName = "oracle.jdbc.driver.OracleDriver";
                    String JNDIName = "orcl";
                    String userName = "act_db";               // TODO: Fill in database user
                    String password = "act_db";          // TODO: Fill in password
                    // Switch all tables on the main report and sub reports
                    CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
                    // logon to database
                    CRJavaHelper.logonDataSource(clientDoc, userName, password);
               // ****** END SET RUNTIME DATABASE CREDENTIALS ****************           
               // ****** BEGIN CONNECT PARAMETERS SNIPPET ****************          
                    // STRING VALUE PARAMETER. 
                    String stringValue = request.getParameter("DeptId");;     // TODO: Fill in value
                    CRJavaHelper.addDiscreteParameterValue(clientDoc, "", "DeptId", stringValue);
               // ****** END CONNECT PARAMETERS SNIPPET ****************     
               // Store the report document in session
               session.setAttribute(reportName, clientDoc);
          // ****** BEGIN CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET **************** 
               // Create the CrystalReportViewer object
               CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
               String reportSourceSessionKey = reportName+"ReportSource";
               session.removeAttribute("reportSource");
               Object reportSource = session.getAttribute(reportSourceSessionKey);
               if (reportSource == null)
                    reportSource = clientDoc.getReportSource();
                    session.setAttribute(reportSourceSessionKey, reportSource);
               //     set the reportsource property of the viewer
               crystalReportPageViewer.setReportSource(reportSource);
               crystalReportPageViewer.setDisplayGroupTree(false);
             session.removeValue("reportSource");
               crystalReportPageViewer.setHasRefreshButton(true);
               // Apply the viewer preference attributes
               // Process the report
               crystalReportPageViewer.processHttpRequest(request, response, application, null);
          // ****** END CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET ****************          
     } catch (ReportSDKExceptionBase e) {
         out.println(e);
Thanks In advance
Regards,
Amol Patil

CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
     viewer.setReportSource(reportSource);
     viewer.setHasRefreshButton(true);
     viewer.setOwnPage(true);
     viewer.setOwnForm(true);
     viewer.setHasExportButton(true);
     viewer.setZoomFactor(100);
     viewer.setPrintMode(CrPrintMode.ACTIVEX);
    viewer.setParameterFields(fields);
viewer.setEnableParameterPrompt(true); --this line will prompt

Similar Messages

  • Clearing the report from cache....

    Hello all,,,
    In my project iam using crystsal report for eclipse to generate reports.
    Iam using a .jsp page to call my report.(which i got it from the examples of CRE).
    The name of my jsp page is poi.jsp
    The name of my Crystal report is CrystalReport2.rpt
    My problem is this....
    when i run the report first time i can see my poi.jsp page and user can submit
    the parameter and based on the users parameter the report is generated..(ITs working absoultely fine)but when the user runs the report again, its not showing the parameter page (i.e user cannot see poi.jsp) rather its showing the old generated report.
    When i tried using session.invalidate and session.removeAttribute it was showing me the poi.jsp page but the problem is when the user clicks on the print icon or any icon on the report its just showing the poi.jsp page...
    When the user closes the report or when the clicks on the button to generate the report it should show the parameter page (poi.jsp).how can i solve this problem???
    the code what iam using is as follows..( got it from the examples of CRE - database login )
              response.setHeader("Cache-Control","no-cache");
              response.setHeader("Pragma","no-cache");
              response.setDateHeader("Expires",-1);
              response.setHeader("Cache-Control","no-store");
              Object reportSource = session.getAttribute("reportSource");
            if (reportSource == null )
                String report = "CrystalReport2.rpt";
                ReportClientDocument reportClientDoc = new ReportClientDocument();
                reportClientDoc.open(report, 0);
                reportSource = reportClientDoc.getReportSource();
                session.setAttribute("reportSource", reportSource);
            ConnectionInfos connInfos = new ConnectionInfos();
            IConnectionInfo connInfo1 = new ConnectionInfo();         
            connInfo1.setUserName("CS22USER");
            connInfo1.setPassword("CS22USER");
            connInfos.add(connInfo1);
            CrystalReportViewer viewer = new CrystalReportViewer();
            viewer.setReportSource(reportSource);          
              viewer.setEnableLogonPrompt(false);
            viewer.setDatabaseLogonInfos(connInfos);
            if (session.getAttribute("refreshed") == null)                  
                 viewer.refresh();               
                 session.setAttribute("refreshed", "true");           
                 //response.sendRedirect("Test.jsp");
                  //session.removeAttribute("refreshed");    
                  //session.invalidate();
                  //session.removeAttribute("refreshed");       
            viewer.setOwnPage(true);
            viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);                     
            //session.invalidate();

    CrystalReportViewer viewer = new CrystalReportViewer();
    viewer.setReportSource(reportSource);
         viewer.setReportSource(reportSource);
         viewer.setHasRefreshButton(true);
         viewer.setOwnPage(true);
         viewer.setOwnForm(true);
         viewer.setHasExportButton(true);
         viewer.setZoomFactor(100);
         viewer.setPrintMode(CrPrintMode.ACTIVEX);
        viewer.setParameterFields(fields);
    viewer.setEnableParameterPrompt(true); --this line will prompt

  • Help neede very very urgently ... to clear the report from Cache.....

    Hello all,,,
    In my project iam using crystsal report for eclipse to generate reports.
    Iam using a .jsp page to call my report.(which i got it from the examples of CRE).
    The name of my jsp page is poi.jsp
    The name of my Crystal report is CrystalReport2.rpt
    My problem is this....
    when i run the report first time i can see my poi.jsp page and user can submit
    the parameter and based on the users parameter the report is generated..(ITs working absoultely fine)
    but when the user runs the report again, its not showing the parameter page (i.e user cannot see poi.jsp)
    rather its showing the old generated report.
    When i tried using session.invalidate and session.removeAttribute it was showing me the poi.jsp page
    but the problem is when the user clicks on the print icon or any icon on the report its just
    showing the poi.jsp page...
    When the user closes the report or when the clicks on the button to generate the report it should
    show the parameter page (poi.jsp).how can i solve this problem???
    the code what iam using is as follows..( got it from the examples of CRE - database login )
    Object reportSource = session.getAttribute("reportSource");
    if (reportSource == null)
    String report = "CrystalReport2.rpt";
    ReportClientDocument reportClientDoc = new ReportClientDocument();
    reportClientDoc.open(report, 0);
    reportSource = reportClientDoc.getReportSource();
    session.setAttribute("reportSource", reportSource);
    ConnectionInfos connInfos = new ConnectionInfos();
    IConnectionInfo connInfo1 = new ConnectionInfo();
    connInfo1.setUserName("USER");
    connInfo1.setPassword("USER");
    connInfos.add(connInfo1);
    CrystalReportViewer viewer = new CrystalReportViewer();
    viewer.setReportSource(reportSource);
    viewer.setEnableLogonPrompt(false);
    viewer.setDatabaseLogonInfos(connInfos);
    if (session.getAttribute("refreshed") == null)
    viewer.refresh();
    session.setAttribute("refreshed", "true");
    viewer.setOwnPage(true);
    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    //session.removeAttribute("refreshed");
    //session.invalidate();
    thanks in advance
    regards
    jack

    As far as parameter refresh is concerned add in your code
    viewer.setHasRefreshButton(true)
    refresh button is appeared on crystal report toolbar and you can use this button instead of explorer refrsh button and every time you can add new parameters values.
    Also, if you want to update reportsource in session object. means if user wants to view more than one different reports and want to invalidate reportsource form session.
    add in jsp.
    session.removeAttribute("reportSource");
    Happy programming
    Uzma

  • How to stop the Browser from caching my web pages

    Hi There
    Can anyone tell how to stop the browser from caching my jsp pages
    I am using
    <%response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", 0);
    %>
    but this does not work anduser is able to go back to the previous page
    which i dont want and i want the browser to display the message the page has expired
    Help appreciated
    Thanks
    Mumtaz

    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    I have cut paste the code from my jsp which is working. There is one additional line. I do not know if that is the cause but there is no harm in trying that out.
    Srinivasan Ranganathan

  • How to clear the music from iPhone?

    How to clear the music from iPhone?
    Im tyring to update my music on my iPhone, although my old music is remaining on the device.
    I have tried unselecting the sync music and syncing my iPhone, to remove all the songs - didnt work. I have tried unchecking each of the artists, so that none are checked and syncing - didnt work.
    I dont know what else i can try so that the remaining music is completely removed from my device.

    If all music is not removed from your iPhone when deselecting Sync Music under the Music tab for your iPhone sync preferences with iTunes followed by a sync, something is wrong with your iPhone.
    Under the Summary tab for your iPhone sync preferences with iTunes, try selecting Manually manage music and videos. A warning message will be provided indicating doing so will remove all music - and videos - iTunes movies and tv shows from your iPhone.
    If this works, you can switch back to syncing music.
    If this doesn't work either, try restoring your iPhone with iTunes with Sync Music deselected under the Music tab before doing so.

  • How to clear the directory server cache?

    How to clear the directory server cache?
    we are using the directory server 5.2
    Thanks,
    Subbu

    try asking it here - http://forum.java.sun.com/forum.jspa?forumID=761

  • How to stop the report from Web!

    hi,all!
    Now I can start a report from Web with schedule parameter!Can you tell me how to stop the report via the Web server?Or tell me with which patameter.Thank a lot.

    hello,
    there is a CGI/Servlet command called killjob which you pass the job-id of the job you want to kill.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                           

  • How to clear the picture from custom container

    Hi All
    I am uploading the employee image into custom container . for that i have used the below fn modules
    CALL FUNCTION 'HR_IMAGE_EXISTS'
    EXPORTING
    p_pernr = pernr
    * P_TCLAS = 'A'
    * P_BEGDA = '18000101'
    * P_ENDDA = '99991231'
    IMPORTING
    * P_EXISTS =
    p_connect_info = g_connect_info
    EXCEPTIONS
    error_connectiontable = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    CALL FUNCTION 'SCMS_DOC_URL_READ'
    EXPORTING
    * MANDT = SY-MANDT
    stor_cat = space
    crep_id = g_connect_info-archiv_id
    doc_id = g_connect_info-arc_doc_id
    * PHIO_ID =
    comp_id = 'DATA'
    * SIGNATURE = 'X'
    * SECURITY = ' '
    * USE_LOCATION = 'A'
    * LOCATION = ' '
    * HTTP_URL_ONLY = ' '
    dp_url_only = 'X'
    * LIFETIME = ' '
    * NO_CACHE = ' '
    * EXPIRATION =
    * PDF_MODE = ' '
    * URL_EXTENTION = ' '
    * FORCE_GET = ' '
    IMPORTING
    url = g_url
    EXCEPTIONS
    error_config = 1
    error_parameter = 2
    error_signature = 3
    http_not_supported = 4
    docget_not_supported = 5
    not_accessable = 6
    data_provider_error = 7
    tree_not_supported = 8
    not_supported = 9
    OTHERS = 10
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    after getting the url for uploading the picture
    I used load_picture_from_url
    the image is uploaded, but when i try to clear the image from control using picture->clear_picture
    it is not clearing the image
    Please help me how to clear the image.
    Thanks
    Rama

    Hi,
    " Request an URL from the data provider by exporting the pic_data.
    CLEAR url.
    PERFORM load_pic_from_db CHANGING url.
    " load picture
    CALL METHOD cl_gui_picture_1->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'file://C:\sap-logo.gif'.
    CALL METHOD cl_gui_picture_2->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'http://www.sap-press.com/images/logo_books_online_162_50.gif'.
    CALL METHOD cl_gui_picture_3->load_picture_from_url
      EXPORTING
        url = url.
    init = 'X'.
    CALL METHOD cl_gui_cfw=>flush
      EXCEPTIONS
        cntl_system_error = 1
        cntl_error = 2.
    ENDIF.
    Its helpful.
    Regards,
    Raj.

  • How to clear the OTHER memory cache

    Hi there fire fox help,
    I have read the page on 'How to clear the cache' but this does not seam to clear everything.
    When I am editing a website on my computer and viewing the changes through fire fox everything works great, I just hit refresh.
    But when testing the websites changes online (after unloading it) I can not see any changes, using the refresh button is of no help and clear the cache is not helping either.
    I get quite frustrated with this as I then have to change the name of the web page just to get fire fox to refresh it properly and then change it back again.
    Thanks for your time, Max

    I've tried all these and Firefox still won't load the current image. I know it's there because Internet Explorer does load it. Is there anything else I can try or look at?

  • How to Download the report from the workitem?

    Hi,
    I have one typical requirement that is to download the report from the Workitem by the manager?
    Would any body please give the solution and procedure?
    If you have any sample code for that give it tome?
    Early reply is appriciable.
    Regards,
    Chow.

    If it is an ALV report you don't have to do any coding. You don't say which report it is.
    If it is a report that uses write statements you can also export to a spreadsheet, but of course the cell matching is not quite as for ALV reports since the report creator decides the alignment. Use the menu item "System" => "List" => "Save" (the menu item names may be a little different since I have translated them from Norwegian).

  • How to clear the values from a Tab Screen.

    Hi,
    I have created Two Tab in my report by using the below mentioned code.
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK BR_ACB WITH FRAME TITLE TEXT-502.
    PARAMETERS: P_VATNUM   TYPE T001-STCEG,
                 P_NAME     TYPE T001-BUTXT,
                 P_STREET   TYPE rfpdo-KQSUSTRAS,
                 P_CITY     TYPE rfpdo-KQSUPADD02,
                 P_CNTRY    TYPE rfpdo-ALLGINLD.
    SELECTION-SCREEN END OF   BLOCK BR_ACB.
    SELECTION-SCREEN END OF SCREEN 200.
    SELECTION-SCREEN BEGIN OF SCREEN 201 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK br4 WITH FRAME TITLE text-503.
    PARAMETERS: P_IDLU    TYPE LU_IDCODE,
                 P_VATNU   TYPE LU_VATNUM,
                 P_DESIG   TYPE LU_DESIGNATION,
                 p_telf  LIKE rfpdo-asldtelf.       "Telefonnummer
    SELECTION-SCREEN END OF BLOCK br4.
    SELECTION-SCREEN END OF SCREEN 201.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 8 LINES.
    SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1 DEFAULT SCREEN 200.
    SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2 DEFAULT SCREEN 201.
    SELECTION-SCREEN END OF BLOCK tabb1.
    INITIALIZATION.
      tabs1 = text-500.
      tabs2 = text-501.
    Problem I am facing here is when report loads the screen once and I am filling all the valuse in the Tab Screen 200 and 201 and executing the report and when I am reloading any other variant then it is not clearing the valuse present in the Tab Screen 200 and 201.
    Can any buddy help me regarding this to clear the Tab Screen 200 and 201.
    Thanks and best regards,
    Niteesh Rai

    Hi Niteesh,
    I have tested the scenario which you have mentioned above,  Its working fine for me.
    I have filled all the values in screen 200 and 201 as well and saved it as variant Test1, and again
    I have filled all the values in screen 200 and 201 as well and saved it as variant Test2.
    When I am changing the variants from Test1 to Test2 and vice versa.  I displaying their respective data as well.
    Regards,
    Md Ziauddin.

  • Clear the applet from cache

    Hello,
    I use the following html code to open my signed java applet.
    <APPLET CODE="Applet.class" ARCHIVE="applet.jar" WIDTH=100 HEIGHT=100>However if I make some changes into the applet code and open the HTML file in the browser, I see that the applet is being picked up from the applet cache. Thus if users have caching enabled on their systems they will not be able to retrieve the new version that I have made.
    Is there a way to trigger the browser to download not to use the applet from the cache whenever an updated copy is available on the server.
    I need this fix for IE, Mozilla, Netscape..
    Thanks in advance.

    Hello,
    the easiest solution (for me, at least, it was): when you want to reload an applet type x in the java console (it openes when you load the applet; if it doesn't open you may find it in the icons bar at the bottom of your screen) and then reload the applet
    Hope it helps, good luck!

  • How to clear the ADF Entity cache

    Hi All,
    While I'm using an entity based updatable view object,after deleting a record,I created a new record with the same key,It displays the deleted record instead of new record.
    Sample steps:
    1.Create a updatable view object with key attribute name sequence.
    2.I dropped this as table in the view page.
    3.I created a new record for this using CreateInsert action
    4.I entered the values for this new record.
    5.I deleted the new record
    6.Again I created a new record.
    7.If I enter the previous sequence value,it displays the old record values, If I enter a different value the delete record does not affect this.
    So I think,I need to clear the entity cache, but I have used clearCache() of ViewObjectImpl, there is no change.
    If anyone came across the problem and fixed,Please let me know the solution.
    Regards,
    Felix

    You are wrong here. if you don't commit the delete, the record is still there.
    You should not enter the same sequence again anyway. a sequence should be a one time number, once used it's gone. set the new key using a groovy expression and make it read inky in the ui.
    Timo

  • How to Clear the Hierarchy from hierarchy selection tab

    Hallo,
    I've loaded many hierarchies and created many hierarchies under this tab of the infopackage.
    Many of these hierarchies are not used anymore. Now, I have to search through a long list. How can I housekeep this list? I cannot seem to find a function that do this.
    Regards,
    Adette Rosenthal

    Hi Adette,
    try this path:
    RSA1-> Shift+F9
    there u have all the hierarchies that were loaded and you can delete them from there too.
    see u.
    EV.

  • How Can I print directly the report from the printer without showing it ?

    I know how to run the report from Form as it illustrate on this site:
    http://www.lv2000.com/articles/runreport.htm
    but the question here how could i to generate the report directly to the printer without showing it on the screen???
    I search on the net and I find that I should change this line :-
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE, cache);
    to this
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE, printer);
    but it is not working with me :-(
    is there any suggest ?!

    Check if any of these helps
    Re: Direct Printing in Forms10g
    Web.Show_Document() print report directly
    Direct Printing from client PC

Maybe you are looking for

  • Photoshop Elements 12 with OS X Yosemite 10.10.2 doesn't run properly. What can I do?

    I have updated Elements. As soon as I start working on pictures, it stops running. I can't even close the program. Only via Task Manager. Any idea what the problem could be?

  • E7 Chinese Language Pack

    Hi All Has here been any language packs for the E7 released yet? I am wanting to install Chinese fonts on my E7 and I can not found any language packs, Do I need to install the Chinese firmware, if so where can I download that? Thanks

  • Safari Flash error report

    Process: WebKitPluginHost [958] Path: /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS /WebKitPluginHost Identifier: com.apple.WebKit.PluginHost Version: 6531.21 (6531.21.1) Build Info: WebKitPluginHost-65312101~1 Code

  • PixelGrabber + Import

    1. What exactly does the PixelGrabber do? How can I use it(or another technology if better) to differentiate colors on a background for collision pupposes in a game? 2.How do I call methods and variables from one class in another. I know it should be

  • How do I remove Yosemite installation partition

    I have a 2009 iMac with the primary OS disk being an SSD and the secondary disk as my Home drive.  I downloaded Yosemite via the App Store but never installed it.  Instead,  I created a bootable installation USB stick in order to perform a fresh inst