ag201 Posted February 26, 2007 Share Posted February 26, 2007 guys, i have this implementation, when the user clicks on a show report button, a PDF report is generated and the user is able to view it internally within the IE browser using the PDF viewer. now when the user clicks on save a copy on the adobe toolbar, it always saves the report as app.pdf. can i set up my report in such a way, that when the user clicks on save a copy, a meaningfull name shows up. i have this so far,response.setHeader ("Content-Disposition", "inline;filename="pdf-" + getCurrentTime() + ".pdf""); but this doesnt help me set the name. any help guys. thanks. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted April 4, 2007 Share Posted April 4, 2007 Hi, I made some tests and it seems like the response header you tries works, but only if the user save the PDF using the Save As ... option of the browser and not the save button in the Acrobat plugin and only in Firefox.I don't have a solution for you, but you might get better luck on the iText mailing list. I hope this helps.TeodorPost edited by: teodord, at: 2007/04/04 14:08 Link to comment Share on other sites More sharing options...
ag201 Posted April 5, 2007 Author Share Posted April 5, 2007 Thanks, I appreciate it. As long as I know that its not possible, its fine. Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted April 12, 2011 Share Posted April 12, 2011 Hi Teodor -I have a similar issue. It's my experience that the exported (pdf/xls) file DOES come down with a meaningful name, if it is set in the <jasperReport name="foo"> tag.However, there is a related problem: Consider the case where the user requests the report again, but with slightly different parameters. In a web-based application, calling the JasperReportServer webapi to generate a report, the filename is the same as before, so the results are improperly cached.Is there a way that the jasperReport name can be set at runtime, so that I can make it unique (and therefore not cached)? In other systems, we have just attached a sufficiently unique timestamp to the URL parameters but in this case it's just the report name that comes back down. Link to comment Share on other sites More sharing options...
thangalin Posted April 13, 2011 Share Posted April 13, 2011 http://www.whitemagicsoftware.com/software/java/rif/http://www.whitemagicsoftware.com/software/java/rif/api/com/whitemagicsoftware/report/Parameters.html#PARAM_REPORT_FILENAMEThe idea is that you make the file name part of a parameter that is filled in by the HTTP FORM POST action.If you need to include a programmatic item (such as the date), you override a single method to provide the appropriate value.If you have questions, let me know.Post Edited by thangalin at 04/13/2011 23:47 Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted April 14, 2011 Share Posted April 14, 2011 Thanks for your helpful reply!Adding the uniqueness in a http form post parameter (timestamp) is easy on the client side, and similar to what I have done in other systems. It's not clear to me what I need to do on the JasperServer side (my java skills are limited).Thanks again (and in advance!) Link to comment Share on other sites More sharing options...
thangalin Posted April 14, 2011 Share Posted April 14, 2011 http://www.whitemagicsoftware.com/books/indispensable/ Download and read chapter 15. It shows how to use the Report Integration Framework in a JSP environment. http://www.whitemagicsoftware.com/ Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted April 14, 2011 Share Posted April 14, 2011 This looks like an interesting approach, however for this project we're not in a position to introduce a new technology beyond the existing jsp access to JasperServer. Link to comment Share on other sites More sharing options...
thangalin Posted April 14, 2011 Share Posted April 14, 2011 Ah, I thought you were using JasperReports, not JasperServer. The integration framework isn't so much a new technology as a layer of abstraction that simplifies integrating JasperReports with web development. (Essentially, people around the world are all hard-coding the same problems -- including some fairly severe security issues -- into their web applications; this API shields the web application from such tight coupling.)Post Edited by thangalin at 04/14/2011 19:51 Link to comment Share on other sites More sharing options...
rlfisherpbtgroup.com Posted April 14, 2011 Share Posted April 14, 2011 Indeed, I have other applications where the web pages are accessing JasperReportsLibrary, and your approach would be a nice evolution for that someday. But for this problem, yes, the web pages are accessing the reports via requests to JasperReportsServer - that is where I need to make the filename unique to defeat caching on report reruns (with different parameters). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now