pdf emitter gives an "Internet Explorer cannot display the webpage" with IE 8 and https [message #817093] |
Fri, 09 March 2012 16:22 |
Jean-Philippe Torunski Messages: 2 Registered: March 2012 |
Junior Member |
|
|
We solved a big problem and to save people time I thought that I'd post the solution.
None of the reports generated in PDF format were showing up in IE 8 when the https protocol was used. Worked fine with http. Also worked fine with any other browser.
The problem goes beyond BIRT but basically if the "Cache-Control" header is being set to "no-cache" you need to change it to something like "Cache-Control: private,pre-check=0,post-check=0"
What should happen is that IE saves the file to disk and then calls the PDF plugin to read the file. However because caching is turned off and it's an encrypted page IE doesn't store the file at all, so by the time that the pdf plugin tries to read the file it can't.
Also make sure you uncheck "do not save encrypted pages to disk" in the advanced tab of internet options if this is checked.
In order to fix it I just set a filter in my web app to set the header appropriately after the filter chain has processed it:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
chain.doFilter(request, response);
if(request.getParameter("__report") != null &&
("pdf".equals(request.getParameter("__format")) ||
"xls".equals(request.getParameter("__format")))) {
((HttpServletResponse)response)
.setHeader("Cache-Control:", "private,pre-check=0,post-check=0");
}
}
This likely will affect the excel emitter too although I haven't tested.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02923 seconds