Advanced DHTML API application

Besides fundamental functions that DHTML API provides, you can further obtain other instances from DHTMLClientService.

How to get the other instances

//Get a DHTML API instance using the method 1 or
//2 provided in the preceding section, and then
//use the following method to get the other instances.

//The instance "service" is supposed to be derived
//from the above method 1 or 2.

 DHTMLConfig config = service.getDHTMLConfig();
 DHTMLDataInfo dataInfo = service.getDHTMLDataInfo();
 DHTMLWriter writer = service.getDHTMLWriter(sessionId, rptSetId)

How to use the other instances

Customizing DHTML toolbar using the DHTML API

DHTML API provides you with the API interface. With the DHTML API, you can easily embed the DHTML page or components into your own JSP. Here jet.web.dhtml.DHTMLConfig is used to customize your own DHTML toolbar.

To customize the DHTML toolbar, you must add the following code to run_report.jsp in <intall_root>\public_html\dhtmljsp. And this code must be after the RunReport() method.

DHTMLClientService service = DHTMLServiceFactory.getDHTMLClientService(request);
DHTMLConfig     dhtmlConfig = service.getDHTMLConfig();
String SessionID = DHTMLUtil.getSessionID(request);
String RptSetId = DHTMLUtil.getRptSetId(request);
int[] bId = new int[]{DHTMLConstant.TOOLBAR_EXPORTTOPDF,DHTMLConstant.TOOLBAR_EXPORTTOXML,DHTMLConstant.TOOLBAR_SEARCH};
dhtmlConfig.customizeToolbar(SessionID, RptSetId, "View", bId, true);
dhtmlConfig.setUsedToolbar(SessionID, RptSetId, null, "View", true);

Reference: For more information on this topic, see the JReport Javadoc located in <install_root>\help\api.