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
Hanimi ReddyHanimi Reddy 

How to redirect to parent page after generation of pdf/excel?

Hello All,

I have two scenarios.

1) I am generating the excel from vf page,which have button. Right now on button click its redirecting to page and downloading the excel.
  After that its not redirecting to the orginal page? 
2) Also i m generating the pdf from standard detail page on clicking of custom button.
    same thing here also after genrating the pdf its not redirecting to the orginal page.

Please help on these things.....
surasura
I do not think  that is possible becuase we cant perform any actions on pages rendered as excel/pdf  .what I can suggest is  when button or link is clicked load your pdf/excel page in a new tab rather than on the current tab
Pradeep SinghPradeep Singh

For 1st case, You can use  "setRedirect(false)" if you are using apex method with pagereference as return type.It will keep you on the parent page.

For the 2nd case, either open it in a new tab or you can use "iframe" tag.Create a button on main page & write a method to redirect to parent page and inside iframe use the page which is to be rendered as pdf.