Open Jasper Report in new page using servlet

Guys,
Looks very simple but i am having problem making this process work. I am using 11.1.1.4
This is my use case:
- From a employee page, user clicks on a menu item to open report for current employee. I need to pass appropriate report parameters to servlet and open report into new page.
I can successfully call servlet using commandmenuitem and set request parameters and call servlet from backing bean.... but that doesn't open report in a new page.... any way i can do this?
Another option i tried was that using gomenuitem and setting target=blank but in that case i need to pass the parameter using servlet url which i like to avoid.(in case i need to pass many parameters in future) (also values will be set on page so i need to generate url when then click the menuitem...... so there are some hoops and loops i need to go through) I don't know a way to pass the request parameter using backing bean to servlet... i don't think it is possible.
Those are the two approaches i tried.
If you have any better approach...I would appreciate if you can let me know. (i have searched on internet for two days now.... for the solution)
-R
Edited by: polo on Dec 13, 2011 7:22 AM

Hi,
Hope following will useful
http://sameh-nassar.blogspot.com/2009/10/using-jasper-reports-with-jdeveloper.html
http://www.gebs.ro/blog/oracle/jasper-reports-in-adf/

Similar Messages

  • How to open Jasper report in New window (new Browser,new Tab)

    Hi,
    I'm Using oracle jdeveloper 11.1.1.4.0 fusion middleware for Jasper report. i want to open the Jasper report in new window
    In Application On click of CommandMenuItem(ExportToHTML)it opens the New Window,.While opnening this window i want to call a method (This method opens the jasper report in current browser)
    I Tried the afterPhase and beforePhase for this but doesnt work for me.while executing this using beforePhase I'm getting following Exception :
    Pls Help on this.Thanks in Advance......!!
    Java.lang.IllegalStateException: strict servlet API: cannot call getOutputStream() after getWriter()
    at weblogic.servlet.internal.ServletResponseImpl.getOutputStream(ServletResponseImpl.java:280)
    at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112)
    at ReportsDisplayBean.exportHtmlReport(ReportsDisplayBean.java:272)Is any other way to do this ? :(
    Thanks.

    Hi,
    The view itself is a Web Part called an XSLT List View Web Part (XLV for short). This Web Part is stored on an ASPX page that is by default associated with a list or library on your site.
    I suggest you can check if the view page is valid, also, you can try to create another view, then redirect to the view page to see if there is xslt in the page.
    Here are some detailed articels for your reference:
    Create a custom list view using SharePoint Designer
    Using SharePoint Designer 2010 to Work with Web Parts
    How to: Customize the Rendering of a Field on a List View
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Opening new web page using servlet and jasper report. ?

    Hello,
    I am developing one small web application and implementing jasper report in it. I am using jasper report with servlet. Which is generating one pdf file and displaying in same browser. But I want to open this report in new browser. Which is only display that report window. I am trying it. response.setContentType("application/pdf");
                   /response.addHeader("Content-Disposition", "attachment; filename=" // this is basically for downloading pdf file.
                             + request.getParameter("D:/rnext/30-oct-2009/sms/web/jsp/Reports/allstudentsofwholecollege.jasper") + "");
          response.setContentType("application/pdf");
          response.setContentLength(bytes.length);
          servletOutputStream.write(bytes, 0, bytes.length);
          servletOutputStream.flush();
          servletOutputStream.close();In this code it is showing me attachement file of report.
    When I changed the response.addHeader(Content-Disposition", "inline; filename=" // this is basically for downloading pdf file.)
    It is opening in same window. Please help if you can. It is urgent. please help.
    Thanks in advance.
    Manveer

    Use target attribute with link you have placed on you JSP page. [Look Here|http://www.w3schools.com/tags/att_a_target.asp]
    Also remove Content-Disposition header if you want to open file in browser.
    In latest browsers it might be possible you will see new tab opened rather then whole new browser window, This depends on browser settings.

  • How can I open a new page (using "Pages") when I already have another page open?  It just keeps reverting to the page I have opened already and won't let me open another one?

    How can I open a new page (using "Pages") when I already have another page open?  It just keeps reverting to the page I have opened already and won't let me open another one?

    To make a new document, go to File > New From Template chooser and choose the type of document you wish to create.
    To add a new page to an existing document go to Insert > Sections > Blank.

  • Why are pictures and pages missing from doc created in Pages 09 when I try to open it in the new Pages?

    I created a large document earlier this year in Pages 09 ... over 100 pages and it has screen prints, pictures and text boxes ... when I try to open it in the new Pages 5.5.1, all of these pics, text boxes, etc, are missing!!!  I can open it in the old Pages, and they are all there, but in the new Pages, half of my document is missing!  I want to have it work in the new Pages because what if I upgrade to a new computer ... I will not have access to Pages 09 anymore!  Plus, the "Page Layout" option is missing in Pages 5.5.1 - what was Apple thinking with this update?  Please help!

    Bean doesn't do layout and is no longer being developed.
    MsOffice or LibreOffice [free] are alternatives but not at the moment 100% solutions.
    MsOffice has most of the features in a clumsier fashion in most cases but is a bit of a kludge on the Mac.
    LibreOffice has a rather rough user interface and still lacks Pages '09 features.
    Really we are in Limbo until we get something else completely.
    For office work, I suggest LibreOffice or NisusWriter. Just so you can still get at it in the future.
    I have been warning about this inevitability for years. Hasn't made me popular.
    Peter

  • How to print different  header & item data in new pages using smart forms.

    Hi,
    In smart forms I am trying to print header data & their item data. But there are more than one header data for a given input.
    I want to print all the different header data with their item data in new pages using smart forms. Can any one please help to solve the issue.. Its very urgent for me..
    Regards,
    Brajesh

    Hi
    U need to use control break statements to acheive ur requirement.
    Regards,
    Priya

  • How to open sites in a new page instead of a tab?

    I want to open sites in a new page instead of a tab!

    I've seen that before, and unselected the first item, but it didn't help at all!
    It still opens new tabs instead of a new window.

  • To view reports in new page for each cutomer using Report Designer

    HI all
    I have a requirement to view the data (key figures) for each customer in a new page.
    I have created the same using the Report Designer tool.
    Now there is setting for this Group Header 'Customer' i have selected the option 'repeat group header on each page'
    still the query when generated, gives fine results for certain cases but not for all.
    like it will show the each customers in a fresh page for some pages , then in midst there would some 2-3 customers in the same page.
    There is no relation between these customers , they are same as the other customers, no difference at all.then i am not able to figure out the reason why it is behaving so odd.
    Thanks
    Ramesh

    Ramesh,
    right now there really is no way to solve what you are looking for.  There partial solutions, but you will not be able to force a page break in a dynamic report.
    Here is what I have faced, and what I have come up with so far:
    I have a series of reports that have the same column heading, but spread over 5 pages in a fixed structure.  I need to be able to re-use the header and the general report design with 6 reports.  Here is my solution:
    1. Create an outline of the report.  I did all the formatting by creating a report section for each page.  You can force page breaks between the pages.  Upgrade to patch 1502 (came out last week) and you will see some new functionality (such as fit to page, page numbers, etc).
    2. Insert all you page breaks and do all the formatting.
    3. Insert an infoprovider.  Once in, you can just drag and drop the key figure cells into your formatted report.
    4. Create additional modification for formatting as needed.
    This fixes my problem (for now), but I had to do a lot of work to come up with this.  Also, the latest patch (1501 and 1502) has created an issue for me - there is a null exception when I try to use a variable or a filter value in the report body - I can't save the report.  I have an OSS message out, but our BASIS guys are going to be taking the lead on troubleshooting this.
    The reason that you are seeing some customers on the new pages is probably because of "how the cookie falls" - they just fit that way.
    I am trying to be positive and overcome the limitations that are in place right now. If my technical issue is solved, I would recommend upgrading to the new patch (1403 is the latest stable one in my opinion)
    good luck
    Pavel

  • Open oracle report in new window from method

    Hi,
    I have a requirement to do some stuff in the view object, save changes, launch an oracle report 10g in a new window, and then navigate to a new page on a SINGLE button press.
    I can get all this done using a command button to call may backing bean and a goButton to launch my report, but need to combine these into a single button.
    My question is, is there any way to launch my new window and report from the backing bean?
    Or is there some other way to accomplish these requirements?
    this is a JSF/BC app, jdev 10.1.3.3
    Thanks,
    Jim

    What if I have to do validation against the inputs that are used to dynamically generate the report url in the backing bean when clicking the "Button". I couldn't see there is a way for <af:goButton> to implement that. I think there should be some kind of action or listener in the backing where I can do the validation before I decide to open the new window for report.
    I searched the forum and there is a post that will use a form to open the report window using target="_blank" in the form's attribute, but that works only if we don't have to validate the inputs.
    I also tried to find a solution that will open a new windows in the backing bean by invoking a javascript, that javascript function will have the report url generated in the backing bean as the parameter. But so far, I couldn't find one with my ADF version 10.1.3.2.0. It looks like that in ADF 11, this approach might be feasible.
    Any idea, hints?

  • Open a report in new window ADF 11g

    I am trying to open a report in a new window. The problem is that I am having a link in a .jsff file when I click this link I go to another view activity using dialog: outcome and in the constructor of the backing for the target page I write the following code:
    ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
    HttpServletRequest request = (HttpServletRequest) ectx.getRequest();
    String temp = "http://localhost:7101/cms/report";
    try {
    ectx.redirect(temp);
    } catch (IOException e) {
    This code was working fine with ADF 10g but in 11g this code throws for me ResponseAlreadyCommit exception. I think that this is coming because .jsff is using PPR and this is not a full request but it is XMLRequest.
    SO, I tried to use the URL activity and make an outcome to this URL view activity BUT although the report appears but it is not displayed in a new window
    I can't use a javascript because to open a new window because some processing is done in the backing bean for the report parameters send from the page.
    Please any suggestion for this
    Thanks in advance

    Hi,
    one option I would see is to create a task flow that uses a JSPX page. The input parameter for this page would pass in the URL to call. Then you configure the task flow to be called from a call activity in the bounded task flow with the page fragment. On the task flow call activity configure it to open in a separate window
    Frank

  • How to generate jasper report in pdf format using swing

    hi all,
    im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
    1)delegate:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
    return generateReportDto;
    2)sessionBean:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    //Map parameters = new HashMap();
    ReportManager reportManager = new ReportManager();
    3)ReportManager()
    public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
              Connection conn = null;
              try {
                   conn = dataSource.getConnection();
                   //Generate the report to bytes
                   File reportFile = new File(fileName);               
                   byte[] bytes =
                        JasperRunManager.runReportToPdf(
                             reportFile.getPath(),
                             parameters,
                             conn
              //conn.close();
              //Write the bytes to a file
              ByteBuffer buf = ByteBuffer.wrap(bytes);
              File file = new File(outputFileName);
              // (if the file exists)
              boolean append = false;
              // Create a writable file channel
              FileChannel wChannel = new FileOutputStream(file, append).getChannel();
              // Write the ByteBuffer contents; the bytes between the ByteBuffer's
              // position and the limit is written to the file
              wChannel.write(buf);
              // Close the file
              wChannel.close();
              } finally {
                   if (conn != null) {
    conn.close();
    Any help would be highly appreciated. Thanks in advance

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

  • Open Sub Report in New Window

    Hi,
    We have an application which is integrated with crystal reports.
    So when you open a report from the application it opens up in a new window. (Ours is a web based application and crystal reports opens up in IE browser)
    We have some reports which have subreports (on demand ), is there any crystal report configuration through which these subreports can be opened in a new window, as of now they open in the same main report window.
    Thanks in advance

    hello,
    you may wish to look into saving the subreport as a separate report and then:
    1) calling the report via opendocument (if your app sits on top of businessobjects enterprise or crystal reports server)
    2) calling the report via URL reporting if your app does not utilize the above platforms
    i can't guarantee the above will work as it may depend on your environment that you are hosting the reports in.
    see the help guide [here |http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf]for more information on linking
    http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf
    as per using a subreport and opening in a new window, this doesn't really work.
    if you want though, you can use a Report Part link to go from the open subreport back to the main report. please see more on Report Part linking in your crystal report's online help.
    jw

  • Open bookmark in a new tab using mouse only - how?

    Is there a way you can open a bookmarked page in a new tab using your mouse only? Like pressing the middle mouse button in FireFox. I don't like using an extra button on the keyboard to do this, or opening a new, empty tab first and then clicking on a bookmark.

    okay, now this thread can die once again
    LOL
    you can right-click (open in new tab) on bookmarks in your collections page, even those in folders. just can't do this from the bookmarks bar.
    Yes, you're right, you can. (And you can Command-click to immediately open in a new tab - quicker and easier than right-clicking and then choosing a menu item, in my opinion.) I thought of mentioning that earlier, but it was clear to me that Rosalba is looking for a way to open a bookmark in the Bookmarks Menu in a new tab without any additional steps, whether opening the bookmarks collection in a new window first, opening a new tab first, etc.
    Regardless, we have at least gone over what you can do in this thread.

  • Open linked files in new page? Anchor tags?

    I'm making a website for a friend's Pilates studio in iWeb 2008. She has her class schedules as PDF documents, which I've linked in, but there appears to be no way to choose for the PDF to open in a new window (unlike web page links, which come with a little box to check if you want to open them in a new window).
    Also, her husband has requested anchor tags on some of the pages.
    My questions: Is there a way to do this in iWeb 2008? Could I do it if I could access the code? Is there a way to access the code for a specific page?
    Any help would be greatly appreciated!
    Gwen

    Welcome to the Apple Discussions. Anchors are not supported in iWeb (send a feature request to Apple via http://www.apple.com/feedback/iweb.html).
    As far as having pdfs open in a new window you have to first upload the pdf file to the server and then use the hyperlink to a external page and enter the URL to the file on the server. I have a couple of examples on this demo page: LinkTestPage . The links are on the right side of the page and the URL used is listed (for a MMe account).
    OT

  • Report Designer - New Page

    Hi,
    We have created a report designer report that uses a Cost Center hierarchy. We want to display each node of the hierarchy on a new page. There is an option to select Page Break Before/After for the hierarchy header.
    If we select Page Break Before, the issue with this is that the first page of the report displays as blank page and then it works fine. Is there any way to get the page breaks without the blank page?
    Thanks
    Hemant

    Hi Erik,
    In the Report Structure tab, drill down to your desired chracteristic. eg you will have Group level 0 > Group level 1: Company code > Group header 1 > 0COMP_CODE. Position on the characteristic and in the properties you will see a section "Rowpattern" where you can select page break before or after.
    Hope this answers your question,
    Pieter

Maybe you are looking for