Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <apex:page controller="uploadDataTosObject" apiVersion="36.0">
  2. [Code....]
  3. <apex:form>
  4. <script>
  5. function setVal(result)
  6. {
  7. document.getElementById("{!$Component.hdnField}").value =result;
  8. }
  9. </script>
  10. <apex:inputHidden id="hdnField" value="{!myblob}" />
  11. <apex:commandButton value="Post Page" action="{!post}" />
  12. </apex:form>
  13. <script>
  14. setVal();
  15. </script>
  16. <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.js">
  17. </script>
  18. <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/jszip.js"> </script>
  19. <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js"></script>
  20. [Code...]
  21. function to_csv(workbook) {
  22. var result = [];
  23. workbook.SheetNames.forEach(function(sheetName) {
  24. var csv = X.utils.sheet_to_csv(workbook.Sheets[sheetName]);
  25. if(csv.length > 0){
  26. result.push("SHEET: " + sheetName);
  27. result.push("");
  28. result.push(csv);
  29. }
  30. });
  31. output = setval(result.join("n"));
  32. return result.join("n");
  33. }
  34. [Code...]
  35. </body>
  36. </apex:page>
  37.  
  38. public with sharing class uploadDataTosObject {
  39. public String myblob {get; set;}
  40. public void post(){
  41. system.debug(myblob);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement