cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Translate the entire conversation x

execute jasper report from jsp page

RK_10805837
10-Marble

execute jasper report from jsp page

Hi,

 

to execute jasper report from input jsp page I am using the following API-

 ReportHelper.manager.getThirdPartyReportExecuteUrl(reportRef,parameters);

 

Here, the reportRef should be of type ObjectReference and should refer to a Windchill report object. However the object that I get from the jsp page using the request.getParameter("oid") is of type WTDocument. 

 

Now, when I try to send this object in the above API , it gives the error-

java.lang.ClassCastException: class wt.doc.WTDocument cannot be cast to class com.ptc.windchill.enterprise.report.Report (wt.doc.WTDocument and com.ptc.windchill.enterprise.report.Report are in unnamed module of loader 'app')

 

Kindly suggest on how to resolve this.

Thanks,

Ramsha

4 REPLIES 4
HelesicPetr
22-Sapphire II
(To:RK_10805837)

Hi @RK_10805837 

You should search for the report.

How do you define the reportRef and parameters?

The WTDocument object is not report template that can be run as a report... 

The ObjectReference should give you com.ptc.windchill.enterprise.report.Report

 

PetrH

@_1647
13-Aquamarine
(To:HelesicPetr)

Hi @HelesicPetr,

As the report URL doesn't support for fields & execute report method accepts only string hashmap so is there any way we can use the jrbeandatacollection source as a parameter in report?

Basically will create one list in Java with fields and then will pass that to Jrbeandatacollection so will get the data set and we can create the parameter of that data set.

 
HelesicPetr
22-Sapphire II
(To:@_1647)

Hi @_1647 

Could you provide an example? 

Petrh

@_1647
13-Aquamarine
(To:HelesicPetr)

In one of my task i have created an utility to fill the report for where in jrxml i have used fields for affected objects and i stored affected object details in list and tht list  used in JRBeanCollectionDataSource to make data source and then created parameter to use that data source in report. so this did java code but now i want fetch affected objects details from the executeReport method in jsp then is there any way we can use our  fields of affected objects in executeReport method


Now I have created executeReport method but that only works for parameters which we creted in jrxml not for fields.

 

 

used below lines in java code :
JRBeanCollectionDataSource dataSourcelist = new JRBeanCollectionDataSource(affectedObjectList);

parameters.put("affectedObjectDataSet", dataSourcelist);

Now requirement is : fetch affected objects and other cn details  from executeReport method where we return ReportURL.

 

 

Announcements


Top Tags