ActiveReportsJSビューワをJavaScriptコードで生成する際、「ExportsSettings」オプションを使用して、サイドバーで表示される文書プロパティを事前設定することができます。ビューワのサイドバーからエクスポートする方法については、「エクスポートについて」を参照してください。
PDF形式でエクスポートする際に、文書プロパティの事前設定を行うサンプルは、次の通りです。
<script>
const settings = {
pdf: {
title: "Invoice List",
author: "John K",
keywords: "PDF; import; export",
subject: "This is the Invoice List",
userPassword: "user_Pwd",
ownerPassword: "owner_Pwd",
printing: 'lowResolution',
copying: true,
modifying: true,
annotating: true,
contentAccessibility: false,
documentAssembly: false,
pdfVersion: '1.7ext3',
autoPrint: true,
filename: "InvoiceList"
}
};
function load() {
const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });
viewer.open('/reports/Fonts.rdlx-json');
}
</script>
Excel形式でエクスポートする際に、文書プロパティの事前設定を行うサンプルは、次の通りです。
<script>
const settings = {
xlsx: {
creator: 'Jack',
size: 'A4',
orientation: 'landscape',
sheetName: 'Sheet_Details',
password: 'password'
filename: 'Details'
}
};
function load() {
const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });
viewer.open('/reports/Fonts.rdlx-json');
}
</script>
HTML形式でエクスポートする際に、文書プロパティの事前設定を行うサンプルは、次の通りです。
<script>
const settings = {
html: {
title: 'Jack',
multiPage: true,
autoPrint: false,
filename: 'Fonts'
}
};
function load() {
const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });
viewer.open('/reports/Fonts.rdlx-json');
}
</script>