function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MammaMamma 

Requirement: Need to display report in PDF format.

hello,

 

Requirement: Need to display report in PDF format.

 

Tasks done to accomplish the requirement:

 

ReportTemp Object has a repData as String data type.

From csv i m taking all the data as a string format and putting in to repData field. i.e ReportTemp.repData <- csv data.

 

Now i m trying to print that repdata using render as pdf.

 

Issue:

 

in VF when i m trying to call ReportTemp.repData  value. VF is rendering as pdf including all the html tags.

 

The out is put is displayed in this format below.

 

mypdf:

<tabel><tr><td>PDFContent</td></tr></table>

 

 

Observation:

 

Static html content of vf page is parsed, and html tags are not displayed in the output. But dyanamic html content from the ReportTemp.repData is not processed and displayed as it is.

 

Can any one of you please do help me in rendering the csv or blob or xls to pdf format.


 

regards

mamma.

IspitaIspita

Hi,

Can you attach a screen shot of how the value is being shown , also did you try to save everything in a TextArea control of type rich text box and then display the data.

Also try  to first generate a normal VF page , once that turns out to be nice go for using the "renderas=PDf" attritube, this ensure a normal VF page is being generated fine.

 

Hope this helps....

Navatar_DbSupNavatar_DbSup

Hi,

 

You have to use contentType="html" with renderas=”pdf” for escape the html syntax in apex:page

 

<apex:page renderAs="pdf" controller="controllername"  contentType="html"  >

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

MammaMamma

thanks a lot for the post.

 

Is there a way to display generated reports(csv, xls) in the pdf format ?

 

Can you please help with a sample code.

 

MammaMamma

thanks a lot for the post.

 

Is there a way to display generated reports(csv, xls) in the pdf format ?

 

Can you please help with a sample code.