horvatj Posted January 13, 2009 Share Posted January 13, 2009 Dear forum members,I have a report designed with iReport and executed by jasperserver, whcih works fine! If I let the output be a pdf (output=pdf), how may I determine the filename of the pdf?Best regards,Johann Link to comment Share on other sites More sharing options...
anandharaj Posted January 14, 2009 Share Posted January 14, 2009 DO you mean when user execute a report from JS, the default output should be PDF instead of HTML? Link to comment Share on other sites More sharing options...
horvatj Posted January 17, 2009 Author Share Posted January 17, 2009 Yes, I call the report like this:http://www.myserver.com:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/customer1/report1&ParentFolderUri=/reports/customer1&output=pdf&j_username=reportuser&j_password=mpf&report_locale=de_AT&PK=258&LOGO=noAnd this always gives a report1.pdf back to the browser. Is there a way to change this by passing a parameter to jasperserver? Best regards,Johann Link to comment Share on other sites More sharing options...
horvatj Posted January 18, 2009 Author Share Posted January 18, 2009 And: btw user ID & password are shown in the URL in cleartext. How to deal with it? Is there a better solution? Link to comment Share on other sites More sharing options...
swood Posted January 30, 2009 Share Posted January 30, 2009 You can't change the name of the PDF - that's how Acrobat does things.Do you not want security? Try this http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=50689 ShermanJaspersoft Link to comment Share on other sites More sharing options...
horvatj Posted February 7, 2009 Author Share Posted February 7, 2009 swood, Sorry, I can't agree with this:The file sent from jasperserver has nothing to do with an acrobat. Even if you use a text based browser like lynx, which does not make use of any acrobat plugins, you will get a pdf file named like the report is named. So this is definately set inside the jasperserver code. Last year I wrote java code like this:if(parameterRequest.contains("pdf")){ byte[] pdfFile=getReportPdf(reportFile.toString(),parameters); if(pdfFile!=null&&pdfFile.length>0){ resp.setContentType("application/pdf"); resp.setContentLength(pdfFile.length); resp.setHeader("Content-Disposition","attachment;filename="" +parameterFilename+".pdf""); ServletOutputStream ouputStream=resp.getOutputStream(); ouputStream.write(pdfFile,0,pdfFile.length); ouputStream.flush(); ouputStream.close(); } }My simple Servlet ran inside a tomcat and you had to pass an parameter to it to assign the filename... I can't believe that there is no way to set the filename of the pdf file stream sent to the browser...And I think that this should be a common problem, no? Or do you always store your downloaded reports just with the reportname.pdf? Best regardsJohann Link to comment Share on other sites More sharing options...
lucianc Posted February 11, 2009 Share Posted February 11, 2009 horvatjWrote: I can't believe that there is no way to set the filename of the pdf file stream sent to the browser... And I think that this should be a common problem, no? Or do you always store your downloaded reports just with the reportname.pdf? No, there is no way to specify an arbitrary name for the PDF. This might not be a very common request, since it's the first time I hear about it.In any case, log a feature request for this.Regards,Lucian 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