while Exporting to PDF, column content is exceedin

2019-07-30 04:27发布

if i get the column data like this with no space in between

$scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}]; and this is my gridoptions

 $scope.gridOptions = {
columnDefs: [
  { field: 'name' },
  { field: 'name' },
  { field: 'name' }
],
enableGridMenu: true,
enableSelectAll: true,
exporterCsvFilename: 'myFile.csv',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "My Header", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
  return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
},
exporterPdfCustomFormatter: function ( docDefinition ) {
  docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
  docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
  return docDefinition;
},
exporterPdfOrientation: 'landscape',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
  $scope.gridApi = gridApi;
}

};

in export to pdf sheet the content is exceeding the column border, this is my example plunker just a sample

1条回答
Emotional °昔
2楼-- · 2019-07-30 05:18

You can use width: "*" on each column to make it adjust to the content. However, if the content is extremely large, your table may exceed the page size.

查看更多
登录 后发表回答