Guest User

Untitled

a guest
Jun 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <apex:page controller="CVFC_MasterOrder" contentType="application/vnd.ms-excel#{!filename}" cache="true" readOnly="true">
  2. <table>
  3. <thead>
  4. <tr>
  5. <apex:repeat value="{!FieldsExp}" var="f">
  6. <th>{!f.Label}</th>
  7. </apex:repeat>
  8. </tr>
  9. </thead>
  10. <tbody>
  11.  
  12. <apex:repeat value="{!MasterListExp}" var="m">
  13. <tr>
  14. <apex:repeat value="{!FieldsExp}" var="f">
  15. <apex:outputPanel id="rec" rendered="{! If(f.Type == 'textarea' ,true,false) }">
  16.  
  17. <td>{!m[f]} </td>
  18. </apex:outputPanel>
  19. <apex:outputPanel id="rec2" rendered="{! If(f.Type == 'date' ,true,false) }">
  20.  
  21. <td>
  22. <apex:outputText value="{0,date,short}">
  23. <apex:param value="{!m[f]}" />
  24. </apex:outputText>
  25.  
  26. </td>
  27. </apex:outputPanel>
  28. <apex:outputPanel id="rec5" rendered="{! If(f.Type == 'boolean' ,true,false )}">
  29. <apex:outputPanel id="rec3" rendered="{! If(m[f] == true ,true,false ) }" >
  30. <td>Yes </td>
  31. </apex:outputPanel>
  32. <apex:outputPanel id="rec4" rendered="{! If(m[f] == false ,true,false ) }" >
  33. <td>No</td>
  34. </apex:outputPanel>
  35. </apex:outputPanel>
  36. <apex:outputPanel id="rec1" rendered="{! If(f.Type != 'textarea' && f.Type != 'boolean' && f.Type != 'date',true,false) }">
  37. <td><apex:outputfield value="{!m[f]}" /></td>
  38. </apex:outputPanel>
  39. </apex:repeat>
  40. </tr>
  41. </apex:repeat>
  42.  
  43. </tbody>
  44. </table>
  45.  
  46. </apex:page>
  47.  
  48. public pageReference exporttoxls()
  49. {
  50. String query = CUtilityFunctions.generateQueryFromFieldSet('Master_Order__c','MasterOrderQuery',null,wherecondition);
  51. query+= ' LIMIT 50000 ';
  52. System.debug('Query ' + query);
  53. MasterListExp = database.query(query);
  54. filename ='Masterorder'+ Datetime.now().format('yyMMddHHmmss') + '.xls';
  55. return new pageReference('/apex/exporttocsv');
  56. }
Add Comment
Please, Sign In to add comment