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
srikanth challasrikanth challa 

How to create a report in PDF using visual force?

Presently I am using the following syntax but I am getting a blank pdf page with this. Can anyone please help me

<apex:page standardController="Report" renderAs="pdf">
  <apex:iframe src="/00OK0000000TZ2u"/>  
</apex:page>
SaranshSaransh
Try this:
<apex:page renderAs="pdf">
  <apex:iframe src="/00OK0000000TZ2u?isdtp=mn"/>  
</apex:page>
srikanth challasrikanth challa
Saransh,
Thanks for replying, still it is displaying a blank pdf page!
SaranshSaransh
I just realized that after 14' release you can't call cross browser URL in iframe.
You can check using chrome if you are getting below error:
User-added image

There is a workaround but with that you can open report in seperate tab and then download it as PDF using chrome standard way.
<apex:page sidebar="false" showHeader="false">
  <a href="/00OK0000000TZ2u?isdtp=mn" target="_blank">Generate</a>
</apex:page>

 
yeshabyeshab
Srikanth,

any reason to pass a Id in <apex:iframe>?
you can try using <apex:outputtext value="hello"/> and a pdf page is rendered with hello in it.

 
yeshabyeshab
Also, more explanation is given in below links why when using apex:iframe in vf it appears blank:
http://docs.releasenotes.salesforce.com/he-il/winter14/release-notes/rn_186_forcecom_cruc_setup_pages.htm
http://salesforce.stackexchange.com/questions/34236/iframe-in-visualforce-page-not-working-for-standard-sites
srikanth challasrikanth challa
Saransh, actually we want to send the pdf report to the customer. Is there any way which we can generate a report in pdf format directly?User-added image