作成日: 2025/02/18 最終更新日: 2025/02/18
文書種別
制限事項
状況
回避方法あり
詳細
PivotGridでautoRowHeights=trueを設定します。
この時、PDFエクスポートを行うと行ヘッダーの高さが自動調整されません。
これによって行ヘッダー内に長いテキストが存在している場合、テキストが折り返されず途中で見切れます。
この時、PDFエクスポートを行うと行ヘッダーの高さが自動調整されません。
これによって行ヘッダー内に長いテキストが存在している場合、テキストが折り返されず途中で見切れます。
回避方法
PDF出力を行う前に、CSSの追加とautoSizeRowsの実行(例:updateGridStateの処理)を行い、出力後に追加したCSSクラスを削除と再度autoSizeRowsを実行します。
・・・
updateGridState(true);
wjGridPdf.FlexGridPdfConverter.export(pivotGrid, "PivotGrid.pdf", {
maxPages: 10,
scaleMode: wjGridPdf.ScaleMode.PageWidth,
documentOptions: {
compress: true,
header: { declarative: { text: "\t&[Page] of &[Pages]" } },
footer: { declarative: { text: "\t&[Page] of &[Pages]" } },
info: { author: "MESCIUS", title: "PivotGrid" },
},
styles: {
cellStyle: { backgroundColor: "#ffffff", borderColor: "#c6c6c6" },
altCellStyle: { backgroundColor: "#f9f9f9" },
groupCellStyle: { backgroundColor: "#dddddd" },
headerCellStyle: { backgroundColor: "#eaeaea" },
},
});
updateGridState(false);
・・・
function updateGridState(show) {
wjCore.toggleClass(pivotGrid.hostElement, "custom-cell-content", show);
pivotGrid.autoSizeRows();
}
---追加するCSSクラス---
.wj-pivotgrid.custom-cell-content .wj-cell.wj-header{
text-overflow: unset !important;
display: block !important;
white-space: normal;
overflow-wrap: anywhere;
}