Execution of the Jasper Reports
Load report in Windchill
Loading Jasper report involves creation of loader specification file. Follow these steps:
1. For the loader XML, csvname represent the name of loader specification file and this name should be same as the name of your JRXML file. There exists one-to-one relationship between report object and its associated JRXML by name itself.
◦ csvinputPage refers to the input jsp page which is needed for this report object. Developer can check-in their own jsp in their module’s src_web location and that path should be specified under this tag.
◦ csvfolderPath refers to folder where report object will get created inside Windchill user interface.
◦ csvreportTemplateName refers to the report template name which is present in Windchill user interface. This field is optional and can be kept blank, as all the report template information is captured in JRXML.
◦ csvthirdPartyReport refers to the report object that should be executed in third party reporting system with value as 1.
◦ csvreportingSystem mentions the name of reporting system in which report object should get executed. Value JASPER tells that it should be part of JASPER system, empty or COGNOS will specify it to be run in Cognos system.
◦ csvreportExportFormatType is an optional parameter which loads the report with the default format used while executing. You can edit this later through Windchill user interface.
2. Once loader specification file is created, you can write your own custom input.JSP page and deploy it in Windchill codebase.
3. Put the jrxml and related artifacts in respective folders but make sure that your folders are under JasperReports directory. Compile it using below command.
windchill com.ptc.wbr.jasper.util.JRXMLCompiler {your_jrxml_filename}.jrxml
4. Execute below command from Windchill shell for loading the report-object.
windchill wt.load.LoadFromFile -u wcadmin -p wcadmin -d $WT_HOME/loadFiles/reports/{your_spec_filename}.xml
5. After performing step 3, you can verify the .jasper file that is created with your JRXML file. Compiling is done for JRXML file. This file is vulnerable to security attacks and hence execute the binary representation which is jasper file.
6. Be sure to keep any resources like images, fonts, or localization resources alongside JRXML file location. Jasper engine expects all these resources to be kept relative to JRXML or JASPER file. By default Windchill supports all the defaults fonts supported by JVM and Jasper engine, for some special font, you are required to add it manually in Windchill.
7. Any localization resource bundle kept inside Windchill should be relative to JRXML location.
Execute Jasper Report in Windchill User Interface
Following steps must be followed:
1. This illustrates the execution of Report object. Navigate to Windchilll container and under Report folder, locate this Report object under given folder.
2. If any input page is specified, then that jsp is presented on clicking the report object.
3. If no input file exists, then the output is shown, as below
4. You can have any criteria/parameter defined in QML and same should be part of your input.JSP page. Every criteria that you input through jsp is honored.