Customizing buttons for one-step exporting

Seven buttons are provided for one-step exporting. They are Export to PDF, Export to Excel, Export to RTF, Export to HTML, Export to Text, Export to PS, and Export to XML. By default, the buttons are invisible on the toolbar area. You have to add them to the toolbar area by modifying the index.jsp file in <install_root>\public_html\dhtmljsp.

Use the following two API functions to control the buttons:

Explanation of these parameters:

For example, if you want to add the Export to HTML button to the Export toolbar, then:

  1. Open the file index.jsp.
  2. Add the code

    int[] temparray = {DHTMLConstant.TOOLBAR_EXPORTTOHTML};
    dhtmlConfig.customizeToolbar(SessionID, RptSetId, "Standard", temparray, true);

    before

    //<!-- Tool Bar -->
    if(dhtmlConfig.isFeatureEnabled(SessionID, RptSetId, DHTMLConstant.FEATURE_TOOLBAR)){

  3. Start JReport Server.
  4. Run a report in Page Report Studio, and you will see a new button Export to HTML is displayed on the Export toolbar.

To add more than one button to the toolbar area, for example, adding Export to HTML and Export to PDF buttons to the Export toolbar:

  1. Open the file index.jsp.
  2. Add the code

    int[] temparray = {DHTMLConstant.TOOLBAR_EXPORTTOHTML, DHTMLConstant.TOOLBAR_EXPORTTOPDF};
    dhtmlConfig.customizeToolbar(SessionID, RptSetId, "Standard", temparray, true);

    before

    //<!-- Tool Bar -->
    if(dhtmlConfig.isFeatureEnabled(SessionID, RptSetId, DHTMLConstant.FEATURE_TOOLBAR)){

  3. Start JReport Server.
  4. Run a report in Page Report Studio, and you will see the buttons Export to HTML and Export to PDF are displayed on the Export toolbar.
  5. Click the added button on the toolbar of the report page, the report will be exported to the corresponding format, using the default values of the format options.