Skip to content

A free open source IT asset/license management system

saves bootstrap pdf tables in landscape

Godfrey M83d0743ab8db
diff --git a/resources/assets/js/extensions/export/tableExport.js b/resources/assets/js/extensions/export/tableExport.js
index 124621767c..e3334d353f 100644
--- a/resources/assets/js/extensions/export/tableExport.js
+++ b/resources/assets/js/extensions/export/tableExport.js
@@ -84,7 +84,7 @@
pdfmake: {
enabled: false, // true: use pdfmake instead of jspdf and jspdf-autotable (experimental)
docDefinition: {
- pageOrientation: 'portrait', // 'portrait' or 'landscape'
+ pageOrientation: 'landscape', // 'portrait' or 'landscape'
defaultStyle: {
font: 'Roboto' // default is 'Roboto', for arabic font set this option to 'Mirza' and include mirza_fonts.js
}
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index c354eeea3b..1dc35df6bf 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -34,6 +34,7 @@
data_export_options = $(this).attr('data-export-options');
export_options = data_export_options ? JSON.parse(data_export_options) : {};
export_options['htmlContent'] = false; // this is already the default; but let's be explicit about it
+ export_options['jspdf']= {"orientation": "l"};
// the following callback method is necessary to prevent XSS vulnerabilities
// (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export)
export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {