Coding Decisions in Downloading report to CSV via button

A new enhancement ( insert the report criteria in the csv file) has been requested for our apex application.
I found this example which is pretty good and does just what I want.
[how to download via a button|http://forums.oracle.com/forums/thread.jspa?messageID=3483451&#3483451]
This is all pretty good so far.
The problem is that I don't really want to have a separate page for each report. So I'm looking for the best way to do this generically.
Currently All of my reports are of type sql query
The reports can and do have different selection criteria.
Currently my thinking is to have a packaged procedure which will accept the input with different routines to print the criteria,
and the report data.
I'm also thinking I would be better off with a function returning query if I am to go down this route.

I have come up with the following solution:
The before header process will have an item PX_report_title where X is the page number that the before header process will run on.
I will then have an if elsif block for each report.
Each block will then print out the report criteria.
print out the report column headings
print out the report data (This will be the same query as on the original report, except for it will be contained within a cursor for loop).
At least this way, I only have one page for all my excel downloads rather than having a separate download page for each report.

Similar Messages

  • Download Reports in CSV or pdf format

    Hi to all,
    i'm trying to download a report in CSV format that implicate the list of more than 400.000 users and their resource assigned.
    As i know, Sun IDM before generating this file is going to execute a task that return the list of this 400.000 users, and only after
    that IDM ask me with a window alert if i want to only to "View" or if i want to "Save" the CSV file.
    I noticed that in the moment that IDM is asking me if i want to save and where to save, i wasn't logged in IDM, so
    i'm able to see only the task that is executed with success and the list of users in the task but any CSV or request to save CSV file.
    Do you think that i need an open IDM session with the same IDM user that i execute the report in the moment to save the CSV?
    And what about the task that was already executed: how can i download the CSV without executing another time the task?
    Thanks in advance
    Best Regards

    I noticed that in the moment that IDM is asking me if i want to save
    and where to save, i wasn't logged in IDM, so i'm able to see only the
    task that is executed with success and the list of users in the task
    but any CSV or request to save CSV file.The following method converts a finished report to a string in CSV format:
      public static String printReportsAsCSV(String taskName, String sep, Locale locale)
        throws WavesetException {
        TaskManager tm = Server.getServer().getTaskManager();
        RepositoryResult er = tm.getExtendedResult(taskName, null);
        if(er != null && er.hasNext()) {
          ReportRenderer rend = new ReportRenderer(locale);
          StringBuffer sb = new StringBuffer();
          while(er.hasNext()) {
            TaskResult tr = (TaskResult)er.next().getObject();
            WavesetResult res = tr.getResult();
            if(res != null && res.getResults() != null && res.getResults().size() > 0) {
              Report report = (Report)res.getResult("report");
              rend.renderToSeparatedText(report, sb, sep);
              return sb.toString();
        return null;
      }Usage example:
    System.out.println(printReportsAsCSV("All Admin Roles", ",", Locale.getDefault()));The report is stored in the repository as a TaskResult object, so you
    can also export it in XML form and process with XSL or something.
    Cheers,
    Vladimir

  • Error while downloading report into CSV or EXCEL

    Hi All,
    I am facing a strange problem while downloading data in excel or CSV format. I have created a report that is nothing but output of direct database request. The report is running fine and able to download data but since yesterday it is throwing error: -
    [nQSError: 17001] Oracle Error code: 1455, message: ORA-01455: converting column overflows integer datatype at OCI call OCIStmtFetch.
    [nQSError: 17012] Bulk fetch failed.
    Sometimes it starts download and after fetching some data it throws this error. The report is bulky and generally it brings around 40 k rows.
    Can anybody faces this error or have any idea about this. Please give some suggestion as I have searched it but not reached to any conclusion. Thanks in advance.
    Thanks
    Ashok

    Hi Thomas,
    Following is the logic implemented in RFC which is giving XSTRING as export parameter
    STEP1      create a dynamic internal table
               Create field catalog for the table   using LVC_FIELDCATALOG_MERGE
                   CALL METHOD cl_alv_table_create=>create_dynamic_table
                        EXPORTING
                           it_fieldcatalog = it_fieldcat
                         IMPORTING
                           ep_table        = dyn_table.
                  CREATE  EXCEL SHEET BY SENDING FIELD CATALOG AND DATA TAB
    STEP2 # Convert text table to xstring.
            CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
              IMPORTING
                buffer   = l_content
              TABLES
                text_tab = lt_data_tab
              EXCEPTIONS
                failed   = 1
                OTHERS   = 2.
    STEP3  *# Psss Data to Netweaver
              PERFORM pass_data_to_nw USING is_import
                                      CHANGING es_attachment_metadata.

  • Apex 4 - How to avoid  2 times doublequotes while download report as csv

    Hi,
    I have created a report which will show text like. Report output has double quotes as typed below
    This is my "test" "report" with 1 column
    This is my "test" "report" with 1 column
    This is my "test" "report" with 1 column
    I have export CSV=YES with link name as download and filename
    when I run this report, it shows me text as shown above but when I click on download link, text file is opened/saved but it has all "(double quotes) shown twice. How can I get it in file as it is
    sample output I get in file is as below
    This is my ""test"" ""report"" with 1 column
    This is my ""test"" ""report"" with 1 column
    This is my ""test"" ""report"" with 1 column
    I want output in file as displayed in report
    Please help

    enable csv output = yes
    seperator =,
    enclosed by = "
    link lable=download
    filename=abc.sql
    When report is displayed it show single column as
    exec insert_db "DPSO",504312,"myserver1.com","T10ELF01","SYMANTEC_I3_U2","C","D"
    exec insert_db "DPSO",504312,"myserver2.com","T10ELF01","VERITAS_I3_ORCL_P1","C","D"
    exec insert_db "DPSO",504312,"myserver3.com","T10OPA02","VERITAS_I3_ORCL_P2","C","D"
    but when i click on download link, it opens/(ask to save) new file but it has following data
    "exec insert_db ""DPSO"",504312,""myserver1.com"",""T10ELF01"",""SYMANTEC_I3_U2"",""C"",""D"""
    "exec insert_db ""DPSO"",504312,""myserver2.com"",""T10ELF01"",""VERITAS_I3_ORCL_P1"",""C"",""D"""
    "exec insert_db ""DPSO"",504312,""myserver3.com"",""T10OPA02"",""VERITAS_I3_ORCL_P2"",""C"",""D"""
    I also tried below but did not help
    enable csv output = yes
    seperator =<blank>
    enclosed by = <blank>
    link lable=download
    filename=abc.sql
    I want exact same output in file as shown in report. Please help/advice

  • How to download report into excel using button?

    Hello Friends,
    I am creating one simple classical report.
    Now, I put one "Download" button on the report output screen.
    I want to do is....
    When I press this download button, One pop-up should be called and should ask for where to download on local PC.and downloaded file should be in excel.
    How to do this?
    Regards,
    RH

    hi..
    First explain that, we hav a standard functionality in ALV to download into EXCEL to your FUNCTIONAL CONSULTANT or to your CTM. It is our duty to explain the technical functionality and make use of it wisely. There's nothing wrong in expressing your thoughts regarding requirement. And dont blindly accept requirements and try to interact with FC about it. To me, using a button to download to excel in ALV report is not wise.
    regards,
    Padma

  • Printing and downloading report via BUTTONs

    Hi,
    I want to be able to allow my users to download a report in PDF format using a button... or... be able to print the report using another button... I know these are built in features in interactive report but want to do the same using a button...
    please advice how to do it...
    Thanks in advance

    Hi,
    Interactive report uses the page request to download report, for example if your page request if CSV it will download report as CSV file, if its PDF it will download as PDF file.
    1. Click on create button, select a region and click next
    2. Accept default and click next
    3. Enter the name of the button, select button type and in the action select "Redirect to URL without submitting page " then click next
    4. Accept default and click next
    5. Select display position (usually I pick right of interactive report search bar) and click next
    6. Select target as Page in this application (default selected)
    7. Enter "&APP_PAGE_ID." in the page text box , in the Request use CSV for csv download, PDF for pdf download.
    8. Click on create buttonRun the page and you should able to download the IR report using button. Thanks.
    --Manish                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to generate reports in CSV format using content tracker

    Hi all,
    I have installed Content Tracker and Content Tracker Reports components.
    Using Content Tracker Reports I can able to view the Reports and there is also
    option for print.
    The requirement is to download reports in CSV format.
    Can anyone help?
    Thanks.

    Hi,
    Can you please help me with the following based on your feedback.
    1) I had created a dashboard page that has multiple analysis in it. The output of the dashboard page has to be generated in pdf format and for multiple Relationship Manager.
    2) I can add the above dashboard page to the agent to schedule for execution and send email for one specific relationship manager. But the issue I am facing is I need to do the same all of the 100s of relationship manager i.e. one agent for each RM. The solution I am looking for is to schedule the dashboard page to be executed using one agent and by passing RM codes one by one and sending the output file through email to the respecitive RM.
    Thanks & Regards,
    RR

  • HELP IR Download filtered saved report to CSV

    Hi there
    My enquiry is to do with the saved reports feature in Interactive Reports Apex 4.1
    I create a default IR report and then I subsequently define a filter on this report effectively limiting the displayed output to the rows of data I want to see. I then save the report which is now a 'private' report. If I run the 'saved' (with the filter condition) IR report it displays the data correctly, with the 'saved' report displaying the correct data on the screen I then click Actions->Download and then select CSV - the entire 'primary' report is downloaded -- The filter is ignored!!! Surely the Actions->Download should 'know' that I want download the report that's being displayed (just run) on the screen?
    I think that when you click on the CSV icon the report is re-submitted - How can I get the CSV download to apply the filter that I've defined in the saved report.
    I've searched this forum and found the following similar question being asked
    Re: Problem with export from a saved interactive report
    Interactive Report Download to csv problem
    how to download only filtered data in csv?
    Re: Download Saved Report in IR 4.1
    Thanks in advance
    PS: Is the above an undocumented feature of Apex IR Reports?
    Edited by: boketi on Sep 25, 2012 7:05 AM

    Hi Sathish,
    Thanks for your comment.
    I agree with just a 'default' report the CSV download always gives what is displayed on the screen. If you then define another report with a filter condition and run this 'private' report 'sometimes' the CSV download gives the origional primary report, ignoring the filter condition. Please see the attached links as other people are also getting the same problem.

  • Proxy error when downloading report (IR) in csv format

    I'm getting the error below when downloading IR report in csv format. I'm getting that whenever the records is more than 108,000. Is there a limit in records to download? Is there a resolution.
    I am using apex 4.1, EXCEL 2010.
    Thanks,
    Pinky

    Since it is a text file it should have no limits within reason..
    See if you can recreate issue on Oracle's hosted site..
    Simple test, build a standard report on a table that has 101,000 rows and try downloading and then build a IR report on same table..
    Thank you,
    Tony Miller
    Dallas, TX

  • In R12, can payroll user enter expense report for employees via web-based?

    Hi,
    In R12, can payroll user enter expense report for employees via web-based screen? Previously in 11i, it can be done via the Expense Report forms.
    Appreciate advise on this.
    Thanks in advance.
    Regards,
    Shiau Chin

    Hi Anne,
    Please see page 42 of the [url http://download.oracle.com/docs/cd/B34956_01/current/acrobat/120oieig.pdf]iExpenses Implementation and Admin Guide for R12 . If you are unable to enter the ID as per the guide, I would suggest raising an Service Request with Oracle Support.
    Cheers, Pete

  • Report in CSV format

    In an Apex report SQL query, i had written a statement for the column as
    '<div style="width: 260px;">'|| PARTY_NAME || '</div>' as PARTY_NAME to avoid wrapping of the column text.
    Now, when i download the report in csv format, i get the output in PARTY_NAME column as follows:
    <div style="width: 260px;">SELF</div> instead if SELFPlease suggest the solution.
    Yogesh

    Hi,
    Remove HTML from select.
    Add this to page HTML header
    <style>
    #apexir_PARTY_NAME{width:260px!important}
    </style>Br,Jari
    Edited by: jarola on Jan 21, 2010 9:32 AM
    Code corrected

  • Downloading report from a Tabular form

    Hi,
    I enabled the CSV output as ON in a tabular form to download the report. But the downloaded report has an extra new line (break) after the header and there is an extra column
    at the beginning of each record ( may be due to the check box line selector). Please advice me how to download the report without extra line after the header and extra column at the beginning of each line.
    Thanks,
    Raj
    Edited by: user13686568 on Mar 18, 2011 10:37 AM

    Export file looks ok for me for a tabular form with checkboxes for row selection.
    If want to exclude the checkbox column(or any othe report column) from the export file, go to the *"Report attributes" -> "Column Attributes" (of that column) -> "Include In Export"* field choose "No"

  • Problem when download IR to CSV format in Apex 4.1

    Hi,
    I've an interactive report that using date variables in its query. In order this report to produce data, you must submit those variables otherwise it will show text 'no data found'.
    the report can be produced after those variable is submitted, and clik 'Go' button.
    The problem is when i want to download the report into csv file after i submit those variables, i got a blank csv.
    is it a bug in Apex 4.1 or i miss something ? i need help you all guys.
    thanks a lot.
    Edited by: sureucando on Oct 30, 2012 1:59 AM

    It is more likely an error before generating the report in CSV, I'm having the same problem trying to generate a CSV report showing information with a column of list items in it, when I hide or change the values (remove the list, just leave the values) this column, the report is fine. only happens when I have the list item column shown and with the list displayed.

  • Ibot download report data

    Hi everyone!
    We uses ibot schedule report , when user logon then they can click alter and directly download this report data into cvs file not use open this report,how can do it ?
    Thanks & Regards
    Edited by: user1529789 on 2009-4-27 下午11:00

    It's difficult to understand your english. Are you saying you have an iBot and you want to download the report as CSV? Why not just have the iBot email the user the results in CSV?

  • Misplaced Auditable Attributes in Downloaded Report

    I have a custom audit step that has an auditable attribute. When I run the report and click on the link to see the details, the auditable attribute is displayed correctly. However, when I download the report to csv or pdf, the auditable attribute is displayed under the Client IP heading instead of Auditable Attributes.
    I would appreciate it if you any of you could help me resolve this. I'm using IdM 7.1.

    Hi ,
    Am also facing the same issue.From where did you remove the subject argument. I got the auditable attribute and it collapsed the order of the .CSV file. Am getting like 3- 4 attributes so it collapses with 2- 3 columns in the report.Also let me know how would i update the values of auditable attribute from Wofkflow to waveset table.Please let me know ASAP.
    Thanks in Advance!!

Maybe you are looking for