You need to sign in to do that
Don't have an account?
Aruna
I am trying to create excel sheet with multiple tabs using visulaforce page
I am trying to create excel sheet with multiple tabs using visulaforce page .
I am facing some issues in formating number for example below cell is having number formate with comma separated but when I look @ out put excel sheet the number is not with comma
<Cell ss:StyleID="s23"><Data ss:Type="Number">1,76,213</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">680</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">465</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,756</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,566</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,35,353</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">567</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,564</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">26,752</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">23,015</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">6</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,56,6</Data></Cell>
Out put, if you look @ below screen i need to put some % and $ and different symbols in the cells .
when I ma trying to put those symbols excel sheet is not considering and it is not opening getting file is corrupted and when see the more details is saying one of the cell is having invalid data.
any please suggest how to formate a number using apex visualforce.
Example will be help full
I am facing some issues in formating number for example below cell is having number formate with comma separated but when I look @ out put excel sheet the number is not with comma
<Cell ss:StyleID="s23"><Data ss:Type="Number">1,76,213</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">680</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">465</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,756</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,566</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,35,353</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">567</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,564</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">26,752</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">23,015</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">6</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="Number">4,56,6</Data></Cell>
Out put, if you look @ below screen i need to put some % and $ and different symbols in the cells .
when I ma trying to put those symbols excel sheet is not considering and it is not opening getting file is corrupted and when see the more details is saying one of the cell is having invalid data.
any please suggest how to formate a number using apex visualforce.
Example will be help full
Below is the solution for my question.
<Style ss:ID="s13">
<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000" ss:Arial="1" bgcolor="#FFFF33"/>
<Interior ss:Color="#FFFF33" ss:Pattern="Solid"/>
<NumberFormat ss:Format="Currency"/>
</Style>
<Style ss:ID="s131">
<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000" ss:Arial="1" bgcolor="#FFFF33"/>
<Interior ss:Color="#FFFF33" ss:Pattern="Solid"/>
<NumberFormat ss:Format="Percent"/>
</Style>
All Answers
[1] http://wiert.me/2011/08/25/excel-xml-spreadsheet-styles-and-formatting/
[2] http://stackoverflow.com/questions/17110155/adding-formatting-to-excel-cell
Below is the solution for my question.
<Style ss:ID="s13">
<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000" ss:Arial="1" bgcolor="#FFFF33"/>
<Interior ss:Color="#FFFF33" ss:Pattern="Solid"/>
<NumberFormat ss:Format="Currency"/>
</Style>
<Style ss:ID="s131">
<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000" ss:Arial="1" bgcolor="#FFFF33"/>
<Interior ss:Color="#FFFF33" ss:Pattern="Solid"/>
<NumberFormat ss:Format="Percent"/>
</Style>