• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem displaying title using jasper reports plugin

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the jasper plugin that comes with Struts 2.2.3. The loading and display of my jasper report is fine. The problem is I only see the name of an action as the title and not the name I set in struts.xml. Here is the relevant code from that file:

<result name="xls" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">XLS</param>
<param name="reportParameters">jasperRptParams</param>
<param name="documentName">jasperRptFileName</param>
</result>

The relevant javadoc says that by using the documentName parameter, it would end up setting a ContentDisposition attribute on the response object with
inline;filename="<action.getJasperRptFileName()>.<format>"

However, when I execute the code, the fileName is not being set.

I continued to search and tried another solution, to no avail:

<result name="xls" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">XLS</param>
<param name="reportParameters">jasperRptParams</param>
<param name="contentType">application/application/vnd.ms-excel</param>
<param name="contentDisposition">filename="${jasperRptFileName}.xls"</param>
</result>

No matter what I attempt, only the action is displayed as the title? Any clues as to what I'm doing wrong or how to fix it?

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic