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

We are happy to announce the new Windchill Customization board! Learn more.

Export to Excel

tstacy
1-Newbie

Export to Excel

I'm trying to create my own version of the code that Windchill uses to export Action Items to Excel. I've been looking through the code and it references classes in the package "com.ptc.util.spreadsheet" that I can't find. Anybody know in what jar file these classes are located? I can't compile my code because I need to include these classes in my Classpath.

6 REPLIES 6

I think, the Spreadsheet.jar is available in <Windchill>\srclib\wnc which you can be unjar to windchill\com\ptc\util\ and then you may use it for your code. I am not skilled in customization but giving a try to look into this.

Theresa,

Did you make any progress on this? I have a similar problem: I'm trying to include images in the data that is exported to Excel.

Thanks,

Tom

I decided to go with a JSP that streams my query results out. I set the contentType to "application/vnd.ms-excel". Then I ran my InfoEngine task and looped through the results, getting the values that I wanted to display. My customers didn't want the images, so I don't know if this method would work with them. I did finally locate the spreadsheet.jar file, but by then I had changed direction.

Thank you.

I don't quite understand your response - I don't know what it means to run an InfoEngine task, for instance. And is the JSP is to be triggered independently of the Windchill app, from a separate web app? Or is it somehow wired into the Windchill UI? And how would the JSP interact with the Windchill code?

As you can probably infer, I have no experience with Windchill (I was assigned this task a day or so ago). If you could send me the JSP, or some sample code, that would help tremendously.

Thanks!

The JSP is launched from an action on the tool bar above the results table, like the action "Export Action Items to Excel" on the Assignments table. The original results table is also a JSP that was launched from an action in Windchill. On that original JSP, I saved the parameters used to do the initial search so that I could use them in the Export jsp.

So, I have one set of JSPs that produce the HTML table in a new Internet Explorer window using an InfoEngine task to perform the actual Windchill query. The table has a toolbar containing an action to export the report to Excel. That action launches another set of JSPs, which uses the same InfoEngine task and the same parameter values, to stream the results. Because the second set of JSPs have a contentType of "application/vnd.ms-excel", a window popups up asking the user if they want to open or save the file. I've attached a scrubbed version of the second set of JSPs. There is a header JSP which sets up the page definition and gets the parameter values from the request. The other is the JSP that is launched from the action and includes the header JSP. This JSP runs the InfoEngine task and outputs the information.

Thanks, Theresa!

Top Tags