Running OOTB Change Notice Summary Report with customizations from Java class
- May 16, 2024
- 2 replies
- 1000 views
Version: Windchill 12.0
Use Case: We are trying to display Change Notice Summary Report with customizations from a Java class
Description:
Hello,
I am trying to display the OOTB Change Notice Summary Jasper Report which has some customizations, from a Java class. I am using the following code to load and then fill the Jasper Report:
String path= wthome+"/codebase/JasperReports/Change Management/Change Notice Summary Report.jasper";
path = URLDecoder.decode(path, "UTF-8");
System.out.println("Decoded path:"+path);
File f= new File(path);
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(f);
System.out.println("Report is loaded");
JRXmlDataSource datasource= new JRXmlDataSource("https://"+localURL+"/Windchill/servlet/ReportServlet?proc=com_ptc_windchill_enterprise_report_ReportTask%23ChangeNoticeSummaryHeader&contextOid="+contextOid+"&isDraft=" + isDraft +"&uid="+USERNAME+"&locale="+LOCALE,"/dataset/data/row");
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("contextOid", contextOid);
parameters.put("WINDCHILL_URL", localURL);
parameters.put("USERNAME", USERNAME);
parameters.put("LOCALE", LOCALE);
parameters.put("isDraft", isDraft);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, datasource);
The report is getting loaded but then it throws a MissingResourceException at JasperFillManager. The Change_Notice_Summary_Report.properties file is already present in the location- codebase/JasperReports/Change Management,
where the jasper file is also present.
Can someone please provide any hints for this? I have tried many different ways to resolve this but none worked. The error is attached in the screenshot.
Thanks and Regards,
Ramsha

