cancel
Showing results for 
Search instead for 
Did you mean: 

Export to PDF from JSF 1.2 - Corrupt FIle

Former Member
0 Kudos

Hello,

We're having a hard time with the export to PDF in a web app using JSF 1.2, the files always come out corrupt. Here are the relevant facts as I know them:

- The same reports export fine from the designer, but bad from a browser.

- CR XI R2, running through Tomcat 6 or JBoss 4+. Same problem with each.

- Browser version doesn't seem to matter.

- Example of internal content of two versions of same report. One good, generated through the Designer, one corrupt, generated through the web browser. It looks like the web version is converting PDF content to safe hex for HTML readers.

stream

x&#156:&#237:}&#247:wU&#213:&#246:&#239:&#223:&#240:~&#250:&#142:7&#222:&#253:Ž&#251:&#253:>&#239:E&#238:

(I replaced the ending ";" with ":" so the characters do not convert prior to you seeing the underling representation.)

stream

xu0153íu2122Ysâ8 u20ACßõ+úa ²U`t yS°'u02DCø ²Cu2020¼Qu0152u201Cõ Ç $µ% ÔÎÌzXgÖUu203AJ t´ÔêOM«m ÀꏨãQu02DC/«*u2020Í 2 y ±< ]óÅ]×"Ðulýµ)

I'm thinking it has something to do with the streaming through a web server that's corrupting the file. This may in tern be due to a JSF 1.2 compatibility issue or some setting of which I'm unaware. I would like to find a solution in XI, but am willing to move up to 2008 is need be.

Any help is appreciated.

Dean

Accepted Solutions (0)

Answers (1)

Answers (1)

ted_ueda
Employee
Employee
0 Kudos

JSF is for text.

If you need to stream out a binary, use a Servlet or JSP.

JSF will try to encode the binary stream to the page character encoding.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted,

Thanks for the insight, this sounds like it's clearly part of the issue, but some specifics remain to be sorted out.

1) We are using the Crystal Reports embedded icons in the rendered DHTML page to export to PDF, we are not streaming directly from the back end. The report viewer page is being called through the JSF framework, I say that in light of your comments, because it may be relevant.

2) The call to execute and show the report does un through our JSF framework in that the action goes to a backing bean which sets up the report and use the CrysatReportViewer object's processHTTPRequest method to send the report back out to the browser in an empty shell page.

In executing a report, should we avoid traveling back through the JSF framework altogether and just call the viewing jsp directly from the front end?

I've read a little about a JSF reportPageViewer control that comes with BusinessObjects Enterprise. Is this something we should be using and can we use it without BO Enterprise?

Thank you

Dean

ted_ueda
Employee
Employee
0 Kudos

I recommend:

Show the viewer in the web page.

Look at the HTML source.

Do you see two <HTML> tags? One for the Crystal viewer, and another for the surrounding material?

Export request works by postback - if you're embedding the JSF tag in surrounding material, then it'll be interpreted not as binary but as text.

Sincerely,

Ted Ueda