0
あまりにも右である私は、このチュートリアルの次のです:http://ui-grid.info/docs/#/tutorial/206_exporting_dataAngularJS PDFへのUIグリッドのエクスポート - あまりにも左ページ番号とPDFのタイトルが、グリッドが
私はangularjs UIのグリッドを使用しています。しかし、私はPDFにグリッドをエクスポートすると、UIは良く見えません。 問題:ページ番号とPDFのタイトルがあまりにも残っていないが、私はオンラインソリューションを検索してみました
グリッドはあまりにも右ですが、運されます。これは私のグリッドオプションの設定です:
あなたのgridOptions
に、このような何かをしようと、ヘッダーとフッターのスタイルにマージンを追加する必要が
gridOptions = {
showGridFooter: true,
showFooter: false,
enableSorting: true,
multiSelect: false,
enableFiltering: true,
enableRowSelection: true,
enableSelectAll: false,
enableRowHeaderSelection: false,
enableGridMenu: true,
noUnselect: true,
onRegisterApi: function (_gridApi) {
this.gridApi = _gridApi;
},
data: [],
exporterCsvFilename: 'Report.csv',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Foo", 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: 'portrait',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
};
あなたが、値のマージン:[20、20、20、20] 'は私のグリッドをpdfセンターで作ることはできませんが、あなたは私にその考えを与えました。私は自分で値を調整します。ありがとう – EntryLeveDeveloper
ところで、どうやってそれを知っていますか?チュートリアルで解決策が見つかりませんでしたか? – EntryLeveDeveloper
私はCSSを知っていて、私はそのプロパティの中にCSS属性を入れることができると考えました。時間が経っても心配しないで、同じことをします:) – JoxieMedina