Skip to main content
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.

I am trying to create excel sheet with multiple tabs using visulaforce page

any please suggest how to formate a number using apex visualforce.

Example will be help full

 
2 answers
  1. Dec 11, 2015, 4:30 PM
    Thank you for your replay I appreciate your help. Sure next time will do post in EXcel XML structure 

    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>
0/9000