while Exporting to PDF, column content is exceeding the column border in uigrid angularjs

隐身守侯 提交于 2019-12-11 04:43:17

问题


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:


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.



来源:https://stackoverflow.com/questions/37716362/while-exporting-to-pdf-column-content-is-exceeding-the-column-border-in-uigrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!