Jump to content

Customizing the generated report name


bkrishnan82

Recommended Posts

hi,

We are generating the report in the jasper server and the report is generated in the name of flow.html or flow.pdf. But i want to know whether can we change the name of the report generated atrun time i.e according to the name of the report generated. if can, please let me know the steps of how we can do it.

 

with regards,

Krish

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

Hi

We applied this fix to our local version of Jasper Server Community Edition:
(It corrects the naming issue and also allows direct opening or saving of the pdf rather than opening in a browser window.


In ReportPdfExporter.java, setAdditionalResponseHeaders()


remove:

response.setHeader("Content-Disposition", "inline; filename=\"" + getFilename(context, "pdf") + "\"");


replace with:

// allow the download dialog box to open:
response.setHeader("Content-Disposition", "attachment; filename=\"" + getFilename(context, "pdf") + "\"");

// fix for opening PDF in IE6:
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");

 

In view-report.js, exportReport()

comment out or remove these lines so that a blank html window doesn't open:

setBlankFormTarget();
setTimeout('setSelfFormTarget()', 500);

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...