导出为PDF时,列内容超出了uigrid angularjs中的列边界 [英] while Exporting to PDF, column content is exceeding the column border in uigrid angularjs

查看:179
本文介绍了导出为PDF时,列内容超出了uigrid angularjs中的列边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我得到这样的列数据,之间没有空格

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

$scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}]; 这是我的gridoptions

$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;
}

};

在导出到pdf表中时,内容超出了列的边界,这是我的示例代码样本

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

推荐答案

您可以在每列上使用width: "*"使其适应内容.但是,如果内容非常大,则您的表可能会超出页面大小.

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.

这篇关于导出为PDF时,列内容超出了uigrid angularjs中的列边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆