Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. public function tabulator(){
  2.  
  3. DB::select("CALL report1a_respublika('2000/01/01', '2023/01/01')");
  4. $one = DB::select("SELECT * FROM test");
  5.  
  6. $one = json_encode($one);
  7.  
  8. return view ('reports.tabulator', compact('one'));
  9.  
  10. {{-- tabulator tables --}}
  11. <div style='display:none' id="tableZero"></div>
  12. <div id="tableOne" style="margin-top:15px"></div>
  13.  
  14.  
  15. {{-- tabulator script --}}
  16. <script>
  17.  
  18. //define data for table1
  19. var tabledata1 = {!!$one!!}
  20.  
  21. var table0 = new Tabulator("#tableZero", {
  22. layout: "fitDataFill", //fit columns to width of table (optional)
  23. autoColumns: true,
  24. });
  25.  
  26. //define table1
  27. var table1 = new Tabulator("#tableOne", {
  28. data: tabledata1,
  29. autoColumns:true,
  30. layout:"fitDataFill",
  31. movableColumns:true,
  32. selectable:true,
  33. clipboard:true,
  34. });
  35.  
  36. //trigger download of data.xlsx file
  37. var sheets = {
  38. "sheetA": table1,
  39. };
  40.  
  41. downloadXlxs = function(){
  42. table0.download("xlsx", "report.xlsx", {sheets:sheets});
  43. };
  44.  
  45. </script>
  46.  
  47. Replace Period '.' with &#46;
  48.  
  49. &#46;u0411u0438u0448u043au0435u043a":12,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement