You need to sign in to do that
Don't have an account?
MayankAdm
creating csv file through visualforce page
Hi All,
I am creating csv file through apex class and vf page all things working fine only it creating first Row blank
it means data wirte from 2nd row instead of first row
Thanks,
Mayank
some code would be helpful to solve ur issue
Hi Prabha,
What kind of code you are talking
Thanks,
Mayank
Hi,
This is my VF code
<apex:page controller="exportOpportunityToExcelController" contentType="text/csv#testIRAS.csv" >
<apex:repeat value="{!lstWrapOpportunityReln}" var="item">
{!item.rowColumn1},{!item.rowColumn2},{!item.rowColumn3},{!item.rowColumn4}, {!item.rowColumn5},{!item.rowColumn6},{!item.rowColumn7},{!item.rowColumn8},{!item.rowColumn9}, {!item.rowColumn10},{!item.rowColumn11} ,{!item.rowColumn12},{!item.rowColumn13},{!item.rowColumn14},
</apex:repeat>
</apex:page>
Thanks,
Mayank
There might be the issue with formatting for the table.
The first row may be blank because of the extra line between <apex:page> and <apex:repeat>. Try removing that blank line.
Instead, you may want to format the string entirely in apex code, and render the page like this:
Blank lines are emitted when they are present in the Visualforce code. Most of the time, this won't matter, since HTML ignores blank lines (mostly, anyways).
Definitely remove the blank line. New lines in CSV will be seen as a row.
Also, I note there aren't headers defined.
Hi sfdcfox,
Firstly thanks for your reply .I have removed the blank spaces
Now in this way i am implementing
<apex:page controller="exportOpportunityToExcelController" contentType="text/csv#testIRAS.csv" >
<apex:repeat value="{!lstWrapOpportunityReln}" var="item">
{!item.rowColumn1},{!item.rowColumn2},{!item.rowColumn3},{!item.rowColumn4},{!item.rowColumn5},{!item.rowColumn6},{!item.rowColumn7},{!item.rowColumn8},{!item.rowColumn9}, {!item.rowColumn10},{!item.rowColumn11} ,{!item.rowColumn12},{!item.rowColumn13},{!item.rowColumn14}</apex:repeat>
</apex:page>
but still same result I am getting and as per the our requirement we don't need header
Thanks,
Mayank
Any luck with this one? I am also facing the same problem.
Just after I posted this one I changed my code from ;
<apex:page standardController="Account" extensions="accountController" contentType="text/csv#Aconts.csv" cache="true">
{!csvString}
</apex:page>
TO
<apex:page standardController="Account" extensions="accountController" contentType="text/csv#Aconts.csv" cache="true">{!csvString}</apex:page>
and the lines disappeared. Please mark this as solution if ti works for you as well.
Hi Yash,
Its giving same error blank row still not gone
Thanks,
Mayank
Hello :)
I wonder if you kindly check this code for me. i wonder why it dose not work ?? i cant find any error in it, but when i test, the result is not like what i want.
*listOfItems : store the key of mapFieldLabel
Any help, pls :(
Best,
---------------------------
<apex:page standardController="Object__c" showHeader="true" sidebar="false" extensions="theControllerr"
id="Thepage" contentType="text/csv#Export.csv;charset=utf8" cache="true" title="Downlaoding" readOnly="true">
<apex:repeat value="{!listOfItems}" var="a" id="theFieldsLoop">
"{!mapFieldLabel[a]}",
</apex:repeat>
</apex:page>
--------------------------------