问题
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