1

I am generating a excel file through VF Page.In VF I have written XML for generating the structure and features of excel.

Can anyone help me out how to add formulas to each cell of excel file through Apex:repeat.

In the below code I have mentioned R1C1 as Static but I want to do that as dynamic for series of rows

    <apex:repeat value="{!contactList}" var="cost">
 <Row>
 <Cell><Data ss:Type="String">{!cost.MRP}</Data></Cell>
 <Cell><Data ss:Type="String">{!cost.Quantity}</Data></Cell>
 <Cell><Data ss:Type="String" ss:Formula="=R1C1*R1C2"></Data></Cell>
 </Row>
0

1 Answer 1

0

The below code works good

  <apex:repeat value="{!contactList}" var="cost">
     <Row>
     <Cell><Data ss:Type="String">{!cost.MRP}</Data></Cell>
     <Cell><Data ss:Type="String">{!cost.Quantity}</Data></Cell>
     <Cell><Data ss:Type="String" ss:Formula="=R{!rowIndex}C{!columnIndex}*R{!RowIndex}C{!columnIndex+1}"></Data></Cell>
     </Row>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .