#### 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:

- public void customizeToolbar(String SessionId, String RptSetId, String toolbarname, int[] buttonId);
- public void customizeToolbar(String SessionId, String RptSetId, String toolbarname, int[] buttonId, boolean isVisible);

Explanation of these parameters:

- SessionId - session ID, which can be retrieved by DHTMLUtil.getSessionID(request).
- RptSetId - report set ID, which can be retrieved by obDHTMLUtil.getRptSetId(request).
- toolbarname - toolbar name, such as "Standard", "Analysis", "View", or user-defined ones.
- buttonId[] - toolbar button ID. It is an integer array, so you need define an integer array variant.

  For example: int[] mybuttonid ={DHTMLConstant.TOOLBAR_EXPORTTOPDF, DHTMLConstant.TOOLBAR_EXPORTTOXLS, TMLConstant.BTN_EXPORT_TO_RTF}

  The array elements available for one-step exporting are:

  - DHTMLConstant.TOOLBAR_EXPORTTOPDF
  - DHTMLConstant.TOOLBAR_EXPORTTOXLS
  - DHTMLConstant.TOOLBAR_EXPORTTORTF
  - DHTMLConstant.TOOLBAR_EXPORTTOHTML
  - DHTMLConstant.TOOLBAR_EXPORTTOTEXT
  - DHTMLConstant.TOOLBAR_EXPORTTOPS
  - DHTMLConstant.TOOLBAR_EXPORTTOXML
- isVisible - whether or not to show the button(s) defined with buttonID[]. true -- show, false -- hide. This parameter can be absent, and then the value is true.

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, "Export", temparray, true);`

   before

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

3. Start JReport Enterprise Server.
4. Run a report set in the DHTML format, 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, "Export", temparray, true);`

   before

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

3. Start JReport Enterprise Server.
4. Run a report set in the DHTML format, 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.