var pivotPanel = new wijmo.olap.PivotPanel('#pivotPanel', { itemsSource: sample.ordersDetail(10000) }); pivotPanel.rowFields.push('分類名', '商品名'); pivotPanel.rowFields[1].width = 200; pivotPanel.columnFields.push('受注日'); pivotPanel.columnFields[0].format = 'EEEE年度'; pivotPanel.valueFields.push('金額'); pivotPanel.engine.showColumnTotals = 'Subtotals'; pivotPanel.engine.showRowTotals = 'Subtotals'; var pivotGrid = new wijmo.olap.PivotGrid('#pivotGrid', { itemsSource: pivotPanel }); var fontFile = { source: 'http://demo.grapecity.com/wijmo/sample/fonts/ipaexg.ttf', name: 'ipaexg' }, font = new wijmo.pdf.PdfFont('ipaexg'); document.form.savePdf.addEventListener('click', function (e) { wijmo.grid.pdf.FlexGridPdfConverter.export(pivotGrid, 'PivotGrid.pdf', { embeddedFonts: [fontFile], styles: { cellStyle: { font: font } } }); });
<div class="container"> <h3>PDF出力</h3> <p>PivotGridコントロールをPDFファイルに出力します。</p> <form name="form" class="form-inline"> <button id="savePdf" type="button" class="btn btn-default">PDFに保存</button> </form> <div id="pivotGrid"></div> <div id="pivotPanel"></div> </div>