Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page controller="CVFC_MasterOrder" contentType="application/vnd.ms-excel#{!filename}" cache="true" readOnly="true">
- <table>
- <thead>
- <tr>
- <apex:repeat value="{!FieldsExp}" var="f">
- <th>{!f.Label}</th>
- </apex:repeat>
- </tr>
- </thead>
- <tbody>
- <apex:repeat value="{!MasterListExp}" var="m">
- <tr>
- <apex:repeat value="{!FieldsExp}" var="f">
- <apex:outputPanel id="rec" rendered="{! If(f.Type == 'textarea' ,true,false) }">
- <td>{!m[f]} </td>
- </apex:outputPanel>
- <apex:outputPanel id="rec2" rendered="{! If(f.Type == 'date' ,true,false) }">
- <td>
- <apex:outputText value="{0,date,short}">
- <apex:param value="{!m[f]}" />
- </apex:outputText>
- </td>
- </apex:outputPanel>
- <apex:outputPanel id="rec5" rendered="{! If(f.Type == 'boolean' ,true,false )}">
- <apex:outputPanel id="rec3" rendered="{! If(m[f] == true ,true,false ) }" >
- <td>Yes </td>
- </apex:outputPanel>
- <apex:outputPanel id="rec4" rendered="{! If(m[f] == false ,true,false ) }" >
- <td>No</td>
- </apex:outputPanel>
- </apex:outputPanel>
- <apex:outputPanel id="rec1" rendered="{! If(f.Type != 'textarea' && f.Type != 'boolean' && f.Type != 'date',true,false) }">
- <td><apex:outputfield value="{!m[f]}" /></td>
- </apex:outputPanel>
- </apex:repeat>
- </tr>
- </apex:repeat>
- </tbody>
- </table>
- </apex:page>
- public pageReference exporttoxls()
- {
- String query = CUtilityFunctions.generateQueryFromFieldSet('Master_Order__c','MasterOrderQuery',null,wherecondition);
- query+= ' LIMIT 50000 ';
- System.debug('Query ' + query);
- MasterListExp = database.query(query);
- filename ='Masterorder'+ Datetime.now().format('yyMMddHHmmss') + '.xls';
- return new pageReference('/apex/exporttocsv');
- }
Add Comment
Please, Sign In to add comment