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

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

问题描述

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

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

$scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}];这是我的网格选项

 $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 表格时,内容超出了列边界,这是我的示例 plunker 只是一个样品

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天全站免登陆