Created
November 23, 2012 22:32
-
-
Save mickle00/4137588 to your computer and use it in GitHub Desktop.
Hacky workaround to force newLine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page readOnly="true" | |
contentType="application/octet-stream#MyCsv.csv" | |
sidebar="false" | |
standardStylesheets="false" | |
showHeader="false" | |
cache="true" | |
expires="0"> | |
<!-- | |
This will create a newLine, but will insert an empty space in the first column of every row. | |
<apex:outputText value="Column 1,Column 2,Column 3"/> | |
<apex:outputText value="aVal1,aVal2,aVal3"/> | |
<apex:outputText value="bVal1,bVal2,bVal3"/> | |
<apex:outputText value="bVal1,bVal2,bVal3"/> | |
<apex:outputText value="bVal1,bVal2,bVal3"/> | |
<apex:outputText value="bVal1,bVal2,bVal3"/> | |
--> | |
<!-- | |
Use a dummy "rowCount" column to still force a newline, but preserve the actual value (e.g., no uneccessary space) | |
and attempt to not lose too much value by having a somewhat not-useless column (debatable) | |
--> | |
<apex:variable value="{!1}" var="rowNum"/> | |
<apex:outputText value="Row,Column 1,Column 2,Column 3"/> | |
{!rowNum},<apex:outputText value="aVal1,aVal2,aVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/> | |
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/> | |
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/> | |
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/> | |
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment