Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
custom_report [2016/09/22 02:35]
127.0.0.1 external edit
— (current)
Line 1: Line 1:
-Custom reports are written in [[http://www.w3schools.com/xsl/|XSL]]. [[http://www.w3schools.com/xsl/|XSL]] stands for EXtensible Stylesheet Language, a style sheet language for XML documents. (Rel. 3.5) 
  
-The best way to write your first custom report is to clone one of the existing reports in /www/MbtSvr/webrpt folder. 
- 
-Step 1: identify the websvc data set(s) you need for your report. You can use one or multiple websvc data set from [[WebSvc DataSet|WebSvc DataSet]]. 
- 
-Step 2: write XSL, use www/MbtSvr/webRpt/ModelReview.xslt as an example 
- 
-Step 3: define report to config.properties 
- 
-     WEBRPT_rptName=myRpt.xsl;Y;websvcUrl 
- 
-where **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|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, http://host:port, e.g. http://localhost:8888 
-  * @SVRMGR@ - to be replaced by [[Server Manager Edition|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. 
- 
-TestOptimal stores the output of [[WebSvc Dataset|WebSvc Dataset]] and output from your xsl in /temp folder. They are useful for learning what data are available in [[WebSvc Dataset|WebSvc Dataset]] and debugging your xsl. 
- 
-Step 4: Restart TestOptimal server to make the new report available. 
- 
-Step 5: Test the report with a browser with url: 
- 
-     http://localhost:8888/MbtSvr/app=webrpt&name=Model Review&model=Demo_WebStore