V1
V1

Preset Export Pane

The Export topic demonstrated how to export using the Export Pane in the Viewer. If you want to provide default export presets in the export pane, you can do so by using ExportsSettings option as elaborated in this topic.

PDF

The following code pre-fills the export pane for PDF format.

    <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

The following code pre-fills the export pane for Excel format.

    <script>
        const settings = {       
                xlsx: {
                    creator: 'Jack',                                 
                    sheetName: 'Sheet_Details',                   
                    size: 'A4',
                    orientation: 'landscape',
                    password: 'password'
                }};
        function load() {
                const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });
                viewer.open('/reports/Fonts.rdlx-json');
                }
    </script>

HTML

The following code pre-fills the export pane for HTML format.

    <script>
        const settings = {       
                html: {
                    creator: 'Jack',                                 
                    sheetName: 'Sheet_Details',                   
                    size: 'A4',
                    orientation: 'landscape',
                    password: 'password'
                }};
        function load() {
                const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });
                viewer.open('/reports/Fonts.rdlx-json');
                }
    </script>