JRC 2.0 generating CSV with "header" on each row

Using JRC 1.0.x a csv had a header in the first row, and then each data row was a separate row.
Using the latest JRC 2.0 the csv is generated with the headers preceeded each row like this:
Label1,Label2,1,2
Label1,Label2,1,2
This is the code we're using to generate the CSV, what are we doing wrong?
public static void exportCSV(IReportSource reportSource, HttpServletRequest request, HttpServletResponse response, ServletContext  context, boolean attachment, Writer writer)throws ReportSDKExceptionBase {
            CharacterSeparatedValuesExportFormatOptions csvOptions = new CharacterSeparatedValuesExportFormatOptions();
            csvOptions.setSeparator(",");
            csvOptions.setDelimiter("\"");
            csvOptions.setReportSectionsOption(ExportSectionsOption.exportIsolated);
            csvOptions.setGroupSectionsOption(ExportSectionsOption.exportIsolated);
            csvOptions.setExportMode(ExportMode.standardMode);
            ExportOptions exportOptions = new ExportOptions();
            exportOptions.setExportFormatType(ReportExportFormat.characterSeparatedValues);
            exportOptions.setFormatOptions(csvOptions);
            ReportExportControl reportExportControl = new ReportExportControl();
            reportExportControl.setReportSource(reportSource);
            reportExportControl.setExportOptions(exportOptions);
            reportExportControl.setOwnPage(false);
            reportExportControl.setName("pvexport");
            // ExportAsAtttachment(true) prompts for open or save; false opens the report
            // in the specified format after exporting.
            reportExportControl.setExportAsAttachment(attachment);
            // Export the report
            reportExportControl.processHttpRequest(request, response, context, writer);
            reportExportControl.dispose();

There's currently issues passing export options to the export control, so you'd set it to the report before passing to the export control:
<%@ page import="com.crystaldecisions.report.web.viewer.*,
                 com.crystaldecisions.sdk.occa.report.application.OpenReportOptions,
                 com.crystaldecisions.sdk.occa.report.application.ReportClientDocument,
                 com.crystaldecisions.sdk.occa.report.exportoptions.*,
                 java.io.ByteArrayInputStream"
%><%
String reportPath;
ReportClientDocument reportClientDocument;
ICharacterSeparatedValuesExportFormatOptions csvOptions;
ReportExportControl reportExportControl;
ExportOptions exportOptions;
reportPath = "Java_CRJ12_Web_Export_CSV/Consolidated Balance Sheet.rpt";
* Instantiate ReportClientDocument and specify the Java Print Engine as the report processor.
* Open a rpt file and export to CSV.  Stream CSV back to web browser.
reportClientDocument = new ReportClientDocument();
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
reportClientDocument.open(reportPath, OpenReportOptions._openAsReadOnly);
csvOptions = (ICharacterSeparatedValuesExportFormatOptions) reportClientDocument.getSavedExportOptions(ReportExportFormat.characterSeparatedValues);
csvOptions.setGroupSectionsOption(ICharacterSeparatedValuesExportFormatOptions.ExportSectionsOption.exportIsolated);
csvOptions.setReportSectionsOption(ICharacterSeparatedValuesExportFormatOptions.ExportSectionsOption.exportIsolated);
reportClientDocument.setSavedExportOptions(ReportExportFormat.characterSeparatedValues, csvOptions);
exportOptions = new ExportOptions();
exportOptions.setExportFormatType(ReportExportFormat.characterSeparatedValues);
reportExportControl = new ReportExportControl();
reportExportControl.setExportOptions(exportOptions);
reportExportControl.setReportSource(reportClientDocument.getReportSource());
reportExportControl.processHttpRequest(request, response, getServletContext(), null);
%>
Sincerely,
Ted Ueda

Similar Messages

  • ALV Display with header on each page.

    Hi experts,
    I had develop the report which output comes in ALV with heading. While printing the output, suppose there are 60 lines in output and 15 lines on each page so 4 page will print. Now i want the same heading will come on each page.
    Is it possible? if Yes how?
    Pls reply.
    Thanks,
    Abhishek.

    Hi,
    Write the heading in the top-of-page.
    You will have to register the event TOP-OF-PAGE and in the corresponding form write the header.
    Regards,
    Ankur Parab

  • Header after each row in report

    Hi Team,
    In my report i want header should be repeated after each row.
    I m using apex 4.1 and template for report that i m using is STANDARD.
    EXAMPLE:- IF A,B,C are header colums then the report should be like below.
    A B C
    1 2 3
    A B C
    5 6 7
    A B C
    8 9 1
    A B C
    1 2 3
    Please suggest me some way to edit template and getting the report in the desired format.
    Thanks,
    Rajendra

    Hello Thomas,
    sorry for the late answer.
    Here is the part of the coding.
    There is nothing special about conversion,
    I just call the parser and return the XML stream back.
    The parser itself provides this conversion with CR/LF.
    I think it is not the best way to do this, but it works fine and it was very easy.
    best regards
    Werner
         public void execute(InputStream in, OutputStream out) throws StreamTransformationException
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setNamespaceAware(true);
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   Document doc = builder.parse(in);
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer t = tFactory.newTransformer();
                   t.setOutputProperty(OutputKeys.INDENT, "yes");
                   t.transform(new DOMSource(doc), new StreamResult(out));
              catch(Exception e)
                   e.printStackTrace();
                   throw new StreamTransformationException("Mapping Error!", e);

  • Creating TREE REPORT with CHECKBOX against each row

    Hi Friends,
    I need to create a <b>TREE REPORT with  CHECK BOX</b> against each row. when the user selects a row and clicks on a custom button then those should get populated into an internal table. <b>This is HIGH priority</b> one and I have tried my best but couldnt find any solution. Please advise me some sol.
    thanks in advance for your valuable time and help.
    Regards
    srithan
    Message edited by me for easyness
            Reddy

    Hi
    Following code is to add checkboxes in ALV tree:
    FORM add_root_request USING pls_data_ TYPE csg_gs_outtab_p_key__l_is_sub_node_ TYPE c
    CHANGING pl_carrid_key._node = nodes->add_node( related_node = p_key
    relationship = cl_gui_column_tree=>relat_last_child ).
    ... §0.2 if information should be displayed at
    the hierarchy column set the carrid as text for this node
    text = p_ls_data-object.
    node->set_text( text ).
    ... §0.3 set the data for the nes node
    node->set_data_row( p_ls_data ).
    item = node->get_hierarchy_item( ).
    item = node->get_item( 'FCHECKBOX' ). "FCHECKBOX is my radio button field in internal table which I am using to populate the ALV
    item->set_type( if_salv_c_item_type=>checkbox ).
    pl_carrid_key = node->get_key( )._
    CATCH cx_salv_msg.
    ENDFORM_._Following code is for handling checbox_change event
    PERFORM application_action_events.
    FORM application_action_events .
    data: lr_events type ref to cl_salv_events_tree.
    *data gr_events type ref to lcl_handle_events.
    lr_events = gr_tree->get_event( ).
    create object gr_events.
    set handler gr_events->check for lr_events.
    set handler gr_events->on_link_click for lr_events.
    set handler gr_events->on_before_user_command for lr_events.
    set handler gr_events->on_after_user_command for lr_events.
    set handler gr_events->on_keypress for lr_events.
    endform. " application_action_events----
    CLASS lcl_handle_events DEFINITION.
    PUBLIC SECTION.
    METHODS:
    check FOR EVENT checkbox_change OF cl_salv_events_tree IMPORTING node_key columnname checked. "Here node_key is the row number
    ENDCLASS. "lcl_handle_events DEFINITION
    CLASS lcl_handle_events IMPLEMENTATION
    §4.2 implement the events for handling the events of cl_salv_table
    CLASS lcl_handle_events IMPLEMENTATION_._
    METHOD check_._
    WRITE 'hello'_._
    DATA lwa_modify_check_ TYPE REF TO csg_gs_outtab.
    node_key = node_key - 1_._
    READ TABLE csg_gt_list INDEX node_key REFERENCE INTO lwa_modify_check._
    if columnname = 'FCHECKBOX'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->fcheckbox =_ ' '_._
    ELSE_._
    lwa_modify_check->fcheckbox =_ 'X'_._
    ENDIF_._
    ENDIF_._
    if columnname = 'CHECKBOX_READ'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->checkbox_read =_ ' '_._
    ELSE_._
    lwa_modify_check->checkbox_read =_ 'X'_._
    ENDIF_._
    ENDIF_._
    *MODIFY TABLE csg_gt_list from l_wa_modify_check.
    flag_test = flag_test + 1_._
    ENDMETHOD_._ "check
    ENDCLASS_._ "lcl_handle_events IMPLEMENTATION
    Please give me reward points

  • Dynamic table with header on each page

    Hi,
    I am new to livecycle forms. I am not sure if I am asking a silly question but this is what I need to achieve.
    I am designing a pdf form using livecycle designer. Need to build a dynamic table using data from xml. The challenge is I need to have a signature button on each page and the button will be below the table. So if there are for eg. 100 rows of data, then the table should be split into 5 pages of 20 rows each page (each page should have the table header) or based on page content and the button should be on the bottom of each page. Is it possible to achieve this? Also any example/suggestion on implementing signature using signature pad would be greatly appreciated.

    Hi,
    For individual objects, like the button that you want to appear on each page, you should place this on the Master Page. Position the button at the bottom of the page and then make sure that you size the Content Area, so that the button is OUTSIDE of the content area. This way objects on the design page will not overflow over the button. See here: http://assure.ly/g0Wx7r.
    If you are using a Table object for your data, then you can set it to repeat the Header row, see the Object palette.
    If you are using ADEP Designer 10 (latest version of Designer) AND your users will have Acrobat X/Reader X (eg version 10.1), then you could use Flash object for a signature field. See the example here: http://assure.ly/rqCuEn. See "Assure Dynamics Map with Signature" example. Again please note that you will need Acrobat X/Reader X to view this.
    Hope that helps,
    Niall

  • Problem with header for each column

    Hi,
    I want change column header-text dynamically in the table control of module pool programming.Please help me.

    Hi Abhijit,
            no need to put '&' in the variable .You just give the name of the variable as lw_text and also dont forget to expand the Def.Length attribute to equal to the length of that variable in the decalration.It is working for me.
    put the follwoing code in PAI module.
    Data:lw_text(15).
    If cond1 = true.
    lw_text = 'Description 1'.
    elseif cond2 = true.
    lw_text = 'Description 2'.
    Endif.
    Using the above code u can modify dynamically.

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • Internal table in Excel output with Header and Total

    Hi All,
    I have a selection-screen of a report where there is option to specify the path of a file to be stored in local PC. This Report gives output in ALV format which displays header and total of columns.
    Now, the requirement is, when the user specifies a path for the file in selection screen it should download in the specified location with header and total row into an excel format.
    The issue is, I have the internal table with data without total and header row and the total is getting displayed in the screen through ALV feature. I am not sure, how to give the same output in downloaded excel with header row and total as it is displayed on screen.
    Please let me know, if you have any suggestions.
    Thanks & Regards,
    Anshumita.

    try using TOP OF PAGE event and write the number of records in the header part.
    hope this will help.

  • Repeat Group Header on Each Page in Subreport won't reflect when generate by JRC

    Hi All,
    I have a report that contain several Subreports. Inside the Subreport, there are Group Header section. I have checked the option of "Repeat Group Header on Each Page". It works fine when I preview in Crystal Report. But when I using JRC to generate the report result. The group header only display on the first page of the group details.
    More, Crystal 10 Common Monthly Hot Fix (English) already installed.
    Any idea?
    Thanks a lot for your help!
    Donald

    Hi,
    Doesthe JRC engine uses CR10 jars or XI\R2 jars? Can you possibly try it with latest set of Eclipse jars? You can download it from Diamond.
    Thanks
    Aasavari

  • The entity with header id(2) generated the following errors

    Hi all,
    While Implementing in Maintenance Workbench am receiving this error message" The entity with header id(2) generated the following errors".
    Although after the error, half of the work orders have been implemented. that means if there are 12 scheduled works in that 6 have been implemented. Please explain dis. We r using R12.0.6

    Hi,
    Can you find any details about the error in the log files?
    Regards,
    Hussein

  • Generate target/out file with header record as Record Count ?

    Hi Kareem, Please try the below approach. Pipeline 1: Load actual data(without header with record count) from source to target. Let say your file name is intermediate1.dat Pipeline 2: Take the target from pipeline 1 as source and create the header with count of source file using an aggregator. The filename of target for pipeline 2 will be your final file(header and detail data). Pipeline 3: Take the target of pipeline 1 again and do 1-to-1 load to the target file of second pipeline. In session properties, dont forget to tick the check box append if exists for the third pipeline target. There may be other simple approaches also. If you have no time in hand try the above approach. Let me know if you find any issues. Thanks,Deeshan.

    Generate target/out file with header record as Record Count ? Out file:---------------------------Record Count :2000  Coulmn1, Column2...Data, data........

  • Generating .csv file with the datas from the database

    Hi Java experts,
    Ihave a current assignment to generate a .CSV file using java getting values from database. The output CSV file may have more than one row and each row should have a end of line delimiter. Any help in giving a template for generating a CSV file accessing from database is greatly appreciated.

    Ihave a current assignment to generate a .CSV file
    using java getting values from database.well, I hope you learn something doing it yourself...
    The output
    CSV file may have more than one row and each row
    should have a end of line delimiter. Any help in
    giving a template for generating a CSV file accessing
    from database is greatly appreciated.How about looking for a JDBC and a file/print stream tutorial?

  • Can RH8 generate a "running header" on all topics, with graphics?

    Can RH8 generate a "running header" on all topics? Does that use the "master page" feature? If so, can said running header also contain a graphic? My output is HTML Help, if that affects your answer.

    Hi there
    Yes, Yes and Yes!
    Yes, you may configure a header. And Yes you use the Master Page to do it. And yes the header may contain an image.
    Cheers... Rick
    Begin learning RoboHelp HTML 7 within the day - $24.95!
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Excel Outputs with Header, page breaks, margins in EBS R12, 10.1.3.2 BI Pub

    Hi All,
    We have most of our report outputs as Excel.
    Our client is expecting a common format for outputs in excel, with header, margins, page breaks , page numbers
    And some of our reports has more than 70 columns
    Using RTF, we could not able to manage this. the header or page breaks are being overwritten when it generated the excel outputs.
    Please let me know how to achive this.
    Thanks in advance
    Edited by: DharV on Oct 15, 2012 8:44 PM

        Hi Rohit ,
    I had copied these .class & .xml files under Myclasses -> oracle.apps.icx and oracle.apps.po and oracle.apps.fnd was same which comes part of the standard OA tutorial.
    I copied same under Myprojects as well.
    you have to decompile the class file into java file and then place it in Myproject directory , also copy all dependency files like BC4J components , and then
    try to run from Jdeveloper .
    Alternatively you can get the entire ICX folder and zip it and add it via library .
    --Keerthi

  • Problems generating csv using bat.xlt in CUCM 8.6.2

    Hello gentlemen
    I`m having some difficulties generating csv from the bat.xlt file downloaded from my CUCM publisher using excel 2010
    I download the file, enable editing and macros, I hit the "create file format" button to generate the columns I need, all looks good so far..
    after filling in some data in the 5 columns I need, witch are Device name, Decsription, Directory number, Display and Line text label (taking care to not enter illigal data, eg boolean, string, integer) I try to press the "Export to BAT format" button.
    a popup message displays "please enter numeric value in the text boxes" and this popup will not go away no matter where I click inside excel after this
    I try to enter a value above 0 in a text box, but I only get to enter a value in one of the boxes before the popup ruins the day, after that the popup message/error message appears immediately if I click anywhere in the spreadsheet
    I have tried to save the file as an "Microsoft excel macro enabled worksheet" (.xlsm) but it doesnt seem to help
    Thanks for your help!
    .xlt file from CUCM included

    Hi Geir,
    It's likely one of these two bugs;
    CSCti42583 - BAT.xlt needs to be supported on 32-bit Office 2010
    Description
    Symptom:
    BAT.xlt does not work in Microsoft excel 2010
    Conditions:
    Microsoft excel 2010
    Workaround:
    None
    Details
    First Found in:                          (2)
    8.6,8.5(1)
    Status:
    Open
    Last Modified:
    May 07,2012
    Product:
    Cisco Unified Communications Manager (CallManager)
    Platform:
    Dependent
    Severity:
    6 - enhancement
    or
    Related Bugs
    CSCtq23985 : Bat.xlt file doesnt work with Localized MS Excel 2010
    Symptom:
    When trying to fill in data in the BAT.xlt file you are getting an error message
    "Please enter numeric values in text boxes"
    While the data entered is perfectly fine.
    Conditions:
    First seen on French Windows Version with French MS Excel 2010
    Workaround:
    Use Bulk Administration -> Export/Import approach instead of the BAT.xlt file.
    Cheers!
    Rob
    "Spend your life waiting,
    for a moment that just don't come,
    Well, don't waste your time waiting" 
    -Springsteen

Maybe you are looking for