You need to sign in to do that
Don't have an account?
Suma Ganga
Export to Excel giving blank page
Hi all,
i have a requirement like, have to export the data to Excel sheet and save it locally.
this part is working fine as per the requirement. but, the main is getting balnk page.
i have a export button in relatedlists, once click on the export button my main page is redirecting to excel_VFP and it is blank, excel is opening with correct data only.
After opening Excel i have to go back to my previous page for this i am using {!$currentpage.Parameters.Referer} in my Export_VFP.
but, no use of this. can anyone please help on this.
i have a requirement like, have to export the data to Excel sheet and save it locally.
this part is working fine as per the requirement. but, the main is getting balnk page.
i have a export button in relatedlists, once click on the export button my main page is redirecting to excel_VFP and it is blank, excel is opening with correct data only.
After opening Excel i have to go back to my previous page for this i am using {!$currentpage.Parameters.Referer} in my Export_VFP.
but, no use of this. can anyone please help on this.
If you still can not resolve please share code.
i have 2 VF Pages(export_VFP & EXportExcel_VFP).
Export_VFP.page::
<apex:page controller="ExportRAIDController" showHeader="false" action="{!exportFun}"></apex:page>
ExportExcel_VFP.page::
<apex:page controller="ExportRAIDController" action="{!exportToExcel}" cache="true" contentType="application/vnd.ms-excel#Export.xls" language="en-US" >
<apex:pageBlock >
{!$CurrentPage.Parameters.Referer} <!-- this line is to go back to the previous page. -->
<apex:pageBlockTable value="{!objLst}" var="object">
<apex:repeat value="{!flds}" var="field">
<apex:column value="{!object[field]}"/>
</apex:repeat>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Controller is::
exportFun is returning page ref. with the dynamic object name and dynamic fields to ExportExcel_VFP. from ExportExcel_VFP.page is opening the excel popup to open or save excel file. but, the page has to go back to provious page. how to achive this..
Thanks in advance.
regards,
Suma.
im just returning pageReference.
like::
pageReference refreshPage = new pageReference('/apex/ExportExcel_VFP?objName='+objName+'&soql='+sql+'&recordId='+recordId);
return refreshPage;
in my ExportExcel_VFP.page is having the contentType="application/vnd.ms-excel#Export.xls". so, im able to get the excel ..
but the main page was blank. after opening that, i have to redirect to previous page.
am i correct...