PDF report to display on new window

Hi,
I am working on JSF and jasper reports. I have the following requirement, When I click the h:command button I should get the report in a new window based on the parameters selected in the h:form. I am currently getting in the same window. Help is greatly appreciated.
following is the action method code in the bean
connection = DBConnect.getDBConnection();
            /* PDF report */
            String              jasperFileName = "";
            jasperFileName = "C:\\report8.jasper";
            // jasperFileName = FacesUtils.getRequest().getContextPath();
            // jasperFileName += "/jasper/ApplicantBiographic.jasper";
            Map<String, Object> parameterMap   = new HashMap<String, Object>();
            /* data input */
            File file = new File(jasperFileName);
            reportInputStream = new FileInputStream(file);
            //FacesContext fc;
            /* write to file */
            request  = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
            String selectedParam = request.getParameter("rpt1:selectParam");
            System.out.println("Param value"+selectedParam);
            response            = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
            servletOutputStream = response.getOutputStream();
            String     spParms   = "4";
             parameterMap.put("prgmId_sel", spParms);
            /* load input parameters */
            //BigDecimal aacomasId = new BigDecimal("10014122008");
            //Integer    applYear  = new Integer(2008);
            // String     spParms   = aacomasId + ", " + applYear;
            //parameterMap.put("SP_PARMS", spParms);
            log.info("file: " + file);          
            log.info(parameterMap);
            /* call jasper method to run report. */
            JasperRunManager.runReportToPdfStream(reportInputStream,
                                                  servletOutputStream, parameterMap, connection);
            FacesContext.getCurrentInstance().responseComplete();
            servletOutputStream.flush();
            servletOutputStream.close();Thanks
Sandeep

Hi,
You may convert the spool of your report into PDF quite simply, this has been discussed many times in this forum.
If you want to provide additional functionalities, especially of your report consists in a table (well, that is generally the case, isn't it), you can use a tableView that provides sorting, filtering, ...
Besides, it is also possible to turn the tableView content into Excel but you already have this one...  
Any reason (release ?) you chose BSP over Web Dynpro ABAP ?
Best regards,
Guillaume

Similar Messages

  • Acrobat 9.0;PDF is black screen/want new window

    Hello,
    Two problems:
    I installed Acrobat Pro 9.0 as part of Creative Suite.  Now PDFs open as a black screen normally (with some opening as normal. 
    I use Mac with 10.8.4 and Safari.
    Also, I want PDFs to open in a new window.  It is frustrating for the PDF to open in my browser window.
    Do I need to install Acrobat Reader?  Doesn't Acrobat Pro 9.0 have a reader?
    This is a new Mac.  On my old Mac PDFs opened as a new window . . . it just did it that way.
    Thanks for help,
    JoAnn

    Acrobat 9 may not be completely compatible with 10.8.4. Whether pdfs in a browser open in a new window is up to the coder of the webpage. Not Acrobat. If you right-clik on the url, you can choose to open the pdf in a new window.

  • How to get generated HTML file to display in new window from FileDownloadActionListener?

    Hi,
    I am using Jdeveloper version 11.1.1.5.
    I have a use case where the user can produce a report upon the click of a command button. They can generate 3 types of reports, HTML, PDF or Excel depending on which option they select in the radio buttons preceding the 'generate report' command button.
    The files are created in the background (XML file created based on View Objects which is then transformed using the relevant API for the report type and then produces a file which is held in servers temp directory) and is served out through a FileDownloadActionListener component programmatically, which itself is surrounded by a Command Link with visibility property set to 'false' (as per this blog:http://www.jobinesh.com/2010/01/customizing-execution-of-to-validate.html).
    Everything works fine in that the reports generate correctly and after clicking on the 'generate report' button the browser's 'Open/Save' dialog box appears asking the user what they would like to do with the file. I am using Internet Explorer as that is what most of the client users will be using.
    The issue I'm having is as follows. For PDF and Excel types when the user clicks on 'Open' the file opens in separate Adobe Reader or MS Excel application windows respectively, which is as expected and required. However, the HTML document opens within the same browser window within which the application is running and from where the 'generate report' button was clicked. The issues this presents is that if the user closes the browser window displaying the report then they will need to open a new window to re-establish connection to the application. If they click the browser 'back' button then it takes them back to the original page but not in exactly the same state as it was before the report was launched i.e. there are some components missing and the page doesn't display correctly.
    Is there another way for me to achieve this or is it even possible? I tried setting the 'useWindow' property of the invisible command link surrounding the FileDownloadActionListener to 'true' which didn't work. I tried to surround it with a Go Link instead of a command link but that gave me NullPointerException's, I think because you can only use a component which has an 'Action' property?
    I appreciate your assistance as always.

    Hi,
      I'm not sure if this solution is appropriate to your situation, but I had the same problem with trying to redirect from a commandLink to a new window.  In the method that is called by the links action I used the following:
    // Open the url in a separate browser window
    ExtendedRenderKitService erks =
      Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    StringBuilder script = new StringBuilder();
    script.append("window.open('" + url + "', '', '');");
    erks.addScript(FacesContext.getCurrentInstance(), script.toString());

  • Links will not display in new window

    I have just install the new version of Thunderbird 31.4.0 and now find when I click on a Link it does not display in a new window. To display the link I have to click on the Explorer tab near the start button. I would like the link to open immediately as it did previously. Thank you very much

    This is not actually a Thunderbird question, but a browser issue, so you should really be asking this in the Firefox forum (assuming you use firefox) as it is the browser not taking the focus.
    However, here is some help if you use Firefox.
    If you use Firefox:
    type : about:config into the Firefox address bar and hit enter. you will get a warning to be careful :)
    In the Search bar, type : diverted look for this line: "browser.tabs.loadDivertedInBackground"
    By default, the value of this entry should be false. This would give you focus on the browser after opening the link.
    So check to see if you may have this set as 'True'.
    To change it, double click on that line and it will toggle the value from 'True to 'False'.
    Restart Firefox .

  • Force PDF to open in a new window from URL

    Is there a way to save a PDF so that it forces IE to open a
    new window when linking to it from a web site? I have no control
    over the HTML code on the site but I need the PDF to not hijack the
    window containing the link.

    Hello justaquestion1112,
    Thank you for your post.
    You should know that these forums are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover the Acrobat family of desktop products.
    Please visit the following Acrobat forums for any questions
    related to the Acrobat family of desktop products:
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/
    Cheers,
    Pete

  • Unable to print multiple copies of PDF using reader X with new Windows 7 computer

    I recently upgraded to a new Windows 7 computer.  Now when I try to print a PDF I can only print one copy.  I have checked that my Mopier Mode is enabled and have tried everything I can think of.  Why could I print multiple copies with Windows XP but can't with Windows 7?

    How does that manifest itself:
    you cannot change the number of copies on the Print panel?
    you can change the number of copies, but it prints only one?

  • Frame content displays in new windows

    I have created a site with frames. The frameset is the opening page (index.html). The site works perfectly in Safari (Mac OS) but in Internet Explorer (Mac & PC) it does not load the links into the specified frames, instead it opens a new window to display the linked page in.  Please help!

    I have created a site with frames.
    A very bad idea.  Experienced web developers don't use Frames.  They were a popular choice late in the last century, but not anymore.  Frames are so poorly regarded now, the W3C saw fit to remove them from HTML 5.0 web standards.  More reasons to avoid Frames:   http://apptools.com/rants/framesevil.php
    Please help!
    People use Frames thinking they will make the site easier to maintain and navigate.  It's a lie.  Ditch the frames and your site will be much less complicated for you and your visitors.
    If you want an easy way to manage headers, menus and footers that don't change from page to page, use DW Templates or Server-Side Includes.
    Guidance  on when to use DW Templates, Library Items and SSIs  -
    http://www.adobe.com/devnet/dreamweaver/articles/ssi_lbi_template.html
    More on DWTemplates -
    http://forums.adobe.com/message/2032104#2032104
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • External links to sub projects cannot be displayed in new window

    Hi
    my question is: while putting hyperlinks to external topics ,
    the options where you choose to open the links in 'New window' or
    'pop up window' becomes inactive. deos this mean I cannot open
    external links in new windows or pop ups????

    Hi there Kathrin
    I think you may be mistaken on this. Moments ago I tested to be certain. I have a CHM that successfully opens another CHM.
    I'm using Windows 7 64 bit.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Dialog framework and commandButton doesn't display in new window

    I'm using a af:commandButton to launch a dialog in a new windows with no luck
    I'm using EA1 and ADF EA 19, my command button is
    <af:commandButton text="dialogo"
    launchListener="#{controladorLink.launch}"
    useWindow="true"
    returnListener="#{controladorLink.regreso}"
    partialSubmit="true"
    action="#{controladorLink.accion}"
    actionListener="#{controladorLink.actionListener}"
    windowHeight="200" windowWidth="300">
    Am I doing something wrong? According to the Dialog Framework documentation you need to set an "useDialog" attribute, but it doesn't exists in commandButton, do I need to use commandLink necessarily?
    Thanks

    Did you take care of these requirements?
    The value bound to the action should return a string of the form "dialog:.....".
    Eg: <af:commandButton text="Show More Information"
    action="dialog:showDetail"/>
    And there is a navigation-case that needs to be added to the faces-config.
    <navigation-rule>
    <from-view-id>/*</from-view-id>
    <navigation-case>
    <from-outcome>dialog:showDetail</from-outcome>
    <to-view-id>/showDetail.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    Hope this helps.
    Thanks,
    Balaji

  • Pdf doesn't display in NEW IE window, even with display in browser checked

    We are using adobe 9.2 and IE 7.  Has anyone had this issue and if so, how did you fix it?
    Thanks in advance!!

    Did you take care of these requirements?
    The value bound to the action should return a string of the form "dialog:.....".
    Eg: <af:commandButton text="Show More Information"
    action="dialog:showDetail"/>
    And there is a navigation-case that needs to be added to the faces-config.
    <navigation-rule>
    <from-view-id>/*</from-view-id>
    <navigation-case>
    <from-outcome>dialog:showDetail</from-outcome>
    <to-view-id>/showDetail.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    Hope this helps.
    Thanks,
    Balaji

  • BI Publisher PDF reports not displaying correctly from EPPM 8.2

    Hi,
    I have setup EPPM to run BI Publisher reports as specified in the documentation. I can see all the reports correctly and can run the reports ok after specifying the reqd parameters. However, when the report completes and tries to open the PDF output in Acrobat, the screen flashes and no output is displayed. This is when running P6 within Internet Explorer. If I run P6 in Firefox, the PDF output opens correctly.
    I presume this is due to an IE setting or because the add-ons aren't configured correctly. Has anyone had the same sort of issue ?, and if so, how did you fix it ?.
    Thanks
    Nik

    Hi Khaja,
    Font mapping is done using xdo.cfg file right ? If yes then yeah I have done it. But the barcodes are not displaying. Infact to display special fonts such as chinese,russian etc I have just pasted the corresponding ttf files under java home and not made any changes to xdo.cfg. But still the specail fonts are displayed properly.Problem is in displaying barcode fonts.
    Thanks,
    Kavitha

  • Create URL for image content and display in new window

    Hi,
    I am attaching a new image and it is displayed in a table view.
    I am having problems creating the URL for the image.
    When i give the link of external site like http://www.google.com, it works fine. It does not work when i give as www.google.com.
    It does not work for the image. Please help.
      ls_properties-name         = 'KW_RELATIVE_URL'.
      ls_properties-value        = lv_imgname.
      APPEND ls_properties TO lt_properties.
      ls_properties-name         = 'LANGUAGE'.
      ls_properties-value        = sy-langu.
      APPEND ls_properties TO lt_properties.
    Assign file properties
      ls_file_access_info-binary_flg = 'X'.
      ls_file_access_info-file_name  = lv_imgname.
      ls_file_access_info-mimetype   = 'image/pjpeg'.
      ls_file_access_info-property   = lv_string2.
      APPEND ls_file_access_info TO lt_file_access_info.
    Move content to file_content
      lv_str = lv_img_content.
      lv_strlen   = XSTRLEN( lv_str ).
      lv_offset   = 1022.
      lv_bytes_rd = 0.
      lv_bytes_rm = lv_strlen.
      ASSIGN lv_str TO <fs>.
      WHILE lv_bytes_rd LT lv_strlen.
        IF  lv_bytes_rm LT lv_offset.
          ls_content-line = <fs>+lv_bytes_rd(lv_bytes_rm).
        ELSE.
          ls_content-line = <fs>+lv_bytes_rd(lv_offset).
        ENDIF.
        APPEND ls_content TO lt_content.
        lv_bytes_rd = lv_bytes_rd + lv_offset.
        lv_bytes_rm = lv_strlen - lv_bytes_rd.
        CLEAR ls_content.
      ENDWHILE.
    Create a Document using class CL_CRM_DOCUMENTS
      CALL METHOD cl_crm_documents=>create_with_table
        EXPORTING
          business_object     = ls_business_object
          properties          = lt_properties
          file_access_info    = lt_file_access_info
          file_content_binary = lt_content
          raw_mode            = 'X'
        IMPORTING
          loio                = ls_loio
          phio                = ls_phio
          error               = ls_error.
    Using the logical and physical id's, get the file location as an URL
    data:
    lv_no type char1 value '1'.
        CALL METHOD cl_crm_documents=>get_with_url
          EXPORTING
            loio     = ls_loio
            phio     = ls_phio
            url_type = '2'
          IMPORTING
            error    = ls_error
            url      = lv_url1.
    should i prefix the url with 'javascript:'?
    Thanks in advance.
    Regards
    Shanthi

    Hi Shanti,
    The URLs that are external to the server, you should always have http://, your image URL is has http:// prefix? Other wise system will always look for the same inside the current BSP application. For Example your BSP application is ZBSP and if you are accessing www.google.com the URL in the browser will be
    *******/bsp/ZBSP/www.google.com which will not be existing, hence causing the problem.
    If not try adding http:// to the URL by concatenation and try.
    Regards,
    Ravi

  • Style and layout for text item displayed in new window

    1. I publish a text item and selects "Link That Displays Item In Full Browser Window".
    2. When I open the item the layout and style of the window is not as wanted.
    Where can I find the template containing this layout and style? How can I create my own layout and style?

    Not possible in the current release of Portal. We're planning templates for text and other item types in a future release.
    Regards,
    Jerry
    PortalPM

  • PDF  Report Iamge Display

    Hi
    I am facing one problem..when I show Image in HTMl it shows correctly.but when i show same image with same height and width it shows bigger image then html..plz give me some reason..thanks in adavance..

    your post makes no sense and apparently has nothing to do with Java

  • Unable to generate Pdf report for crystal 9/10  in Windows 2012 (Standard) server with Times New Roman font. With same font, report getting generated in excel, text, csv format in Windows 2012.

    For Times New Roman font in Windows server 2012 R2 (Standard), crystal 9/10 report in pdf format is not getting generated. When we change the font for specific report like Arial, Calibri , Cambria then pdf report getting created.
    In Windows 2008 R2, same application worked fine to generate pdf report for TimesNewRoman font and there is no change done in the application which is being used in Windows 2012 R2 server.

    Ok, thanks for the reply. You need to contact support or a forum for the Crystal software. Third party products don't usually include Adobe technology, they have their own software. When you contact them, you may want to expand "unable to generate" to give any specific symptoms including any error messages.

Maybe you are looking for

  • How do I set up multiple ipods on one itunes account?

    I know it's possible as I've done it before but I've forgotten how to do it, can anyone help please? :-(

  • Event Creation from Mail is no longer working

    Hello, today I have been trying to create new ical events directly from Mail. This used to work fine and was very useful. Now I get the popup and fill in all the event details but it won't save. I can Cancel but hitting the create/save button does no

  • What's wrong with this (transparent) picture ...?

    There are many posts on the issue of JPG's being converted into PNG's and a variety of replies with sympathetic suggestions for how to avoid this plague. Many months back I also used to see recommendations of making an iWeb graphic into a very reduce

  • Adhoc Query Report

    Hi SAPients.. I have a n issue in Adhoc Query In Adhoc query report ( PQAH ), X person having authorization to see the folder Additional Personal Data (IT0077), but Y person can access the Adoc but could not see the folder (IT0077). Please guide what

  • How to check the owner of any Object in the database.

    How to check the owner of any Object in the database. Thanks Himanshu