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
NK@BITNK@BIT 

reload visualforce page after export csv file

I have a visualforce page in which I reterieve record after search in a pageblock table. I have a button which exports a CSV file for those records. For those CSV records I have written a visualforce page whose content type I have set to CSV. After export CSV file I want to reload the page.
Ravi NarayananRavi Narayanan

<apex:commandButton value="{!export}"  rerender="pageblockid"/> 

If your issue is the page redirecting to blank page after exporting, then try the above steps.

Rerender eiother pageblock or outputpanel in that commandButton. it will prevent from redirecting to blank page after exporting to csv.

 

Ravi NarayananRavi Narayanan
if you want to refresh same page, just specify your pageid instead of pageblockid.

make sure you specify setredirect(false) in your pagereference  method of export CSV /return NULL. 
Shabbir ShaikShabbir Shaik
Hi,

After your Export operation do like this in same method,
Pagereference pf=new Pagereference('/apex/yourpagename');
pf.setredirect(true);
return pf;
Try this...and if this helps, mark this as  'Best Answer'.