You need to sign in to do that
Don't have an account?
Christian Cequina
Problem on generating an XML from VF page: Line break ( ) doesn't work on Header and Footer
Hi everyone,
Please help me on this problem.
I develop a VF page that generate an XML. My problem is ' ' doesn't work on <Header> and <Footer> tag.
The reason is '&' turns to '&' in XML . Is there any other way to do this.
Here is the my sample code:
<apex:page controller="MyController" sidebar="false" cache="true" contentType="application/vnd.ms-excel#{!fileTitle}.xls">
<apex:outputText value="{!XmlHeader}"/>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<!---------------------------------- Documentation --------------------------------->
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author> Salesforce Administrator </Author>
<Created> {!TODAY()} </Created>
<Version> 1 </Version>
</DocumentProperties>
<!----------------------------------------------- Worksheet --------------------------------------------->
<Worksheet ss:Name="sheet">
<Table>
<Column/>
<Column/>
<Row>
<Cell><Data ss:Type="String" >Title</Data></Cell>
<Cell><Data ss:Type="String" >Description</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Layout x:Orientation="Landscape"/>
<Header x:Margin="0.5" x:Data="{!'First line header second line header'}"/>
<Footer x:Margin="0.5" x:Data="{!'First line footer second line footer'}"/>
<PageMargins x:Bottom="0.5" x:Left="0.5" x:Right="0.5" x:Top="0.5"/>
</PageSetUp>
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>9</PaperSizeIndex>
<Scale>58</Scale>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<Zoom>100</Zoom>
<DoNotDisplayGridlines/>
</WorksheetOptions>
</Worksheet>
</Workbook>
<apex:outputText value="{!WorkbookEnd}"/>
</apex:page>
Please help me on this problem.
I develop a VF page that generate an XML. My problem is ' ' doesn't work on <Header> and <Footer> tag.
The reason is '&' turns to '&' in XML . Is there any other way to do this.
Here is the my sample code:
<apex:page controller="MyController" sidebar="false" cache="true" contentType="application/vnd.ms-excel#{!fileTitle}.xls">
<apex:outputText value="{!XmlHeader}"/>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<!---------------------------------- Documentation --------------------------------->
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author> Salesforce Administrator </Author>
<Created> {!TODAY()} </Created>
<Version> 1 </Version>
</DocumentProperties>
<!----------------------------------------------- Worksheet --------------------------------------------->
<Worksheet ss:Name="sheet">
<Table>
<Column/>
<Column/>
<Row>
<Cell><Data ss:Type="String" >Title</Data></Cell>
<Cell><Data ss:Type="String" >Description</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Layout x:Orientation="Landscape"/>
<Header x:Margin="0.5" x:Data="{!'First line header second line header'}"/>
<Footer x:Margin="0.5" x:Data="{!'First line footer second line footer'}"/>
<PageMargins x:Bottom="0.5" x:Left="0.5" x:Right="0.5" x:Top="0.5"/>
</PageSetUp>
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>9</PaperSizeIndex>
<Scale>58</Scale>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<Zoom>100</Zoom>
<DoNotDisplayGridlines/>
</WorksheetOptions>
</Worksheet>
</Workbook>
<apex:outputText value="{!WorkbookEnd}"/>
</apex:page>
I Had the same problem