This is an old revision of the document!
Custom Reports
Custom reports are written in XSL. XSL stands for EXtensible Stylesheet Language, a style sheet language for XML documents.
How to Create a Custom Report
The best way to write your first custom report is to clone one of the existing reports in /www/MbtSvr/webrpt folder and follow the steps below:
- Identify the websvc data set(s) you need for your report. You can use one or multiple websvc data set from WebSvc DataSet.
- Write XSL, use www/MbtSvr/webRpt/ModelReview.xslt as an example
- Define report to config.properties: WEBRPT_rptName=myRpt.xsl;Y;websvcUrl
- Restart TestOptimal server to make the new report available.
Argument Definition
rptName is the name of your report to be displayed in Report menu. Make sure escape space char by prefixing it with backslash “\”. myRpt.xsl is the name of your xsl and websvcUrl is the websvc call to obtain the WebSvc Dataset.
websvcUrl must be a valid url that starts with “http:”. Use the following token to avoid hardcoding the url:
- @CURSVR@ - to be replaced by current TestOptimal server url
- @SVRMGR@ - to be replaced by SvrMgr's url
- @MODEL@ - to be replaced by current model name
- @BATCHID@ - to be replaced by batch id passed as report param
The example above has Y in the middle of the definition, by setting this field to Y, the report will be displayed in Report menu. Otherwise the report will only be available from web.
Output Files
TestOptimal stores the output of WebSvc Dataset and output from your xsl in /temp folder. They are useful for learning what data are available in WebSvc Dataset and debugging your xsl.
Access Custom Report
Access the report with a browser with url:
http://localhost:8888/MbtSvr/app=webrpt&name=Model Review&model=Demo_WebStore