Ar-viewer api methods question

Posted by: david on 13 April 2020, 1:58 pm EST

  • Posted 13 April 2020, 1:58 pm EST

    Hi,

    I have an application with reports loading using the ar-viewer and ActiveReports 14 and .NET Core. I am trying to add an export to PDF button to the toolbar, but review errors that the ```

    viewer.toolbar.addItem

    
    My process:
    
    * "Download ar-viewer using ```
    npm i @grapecity/ar-viewer
    ``` (14.0.1980 version) "
    
    * "Setup app using these instructions https://www.grapecity.com/activereports/docs/v14/online/viewing-reports-using-js-viewer.html"
    
    * "Using example and instructions to add a toolbar item from here https://www.grapecity.com/activereports/docs/v14/online/using-js-viewer.html"
    
    
    Sample code (removed surrounding code for brevity):
    

    import “@grapecity/ar-viewer/dist/jsViewer.min.js”;

    import “@grapecity/ar-viewer/dist/jsViewer.min.css”;

    UpdateDS() {

    const pdfExportButton = {

    key: ‘$pdfExportButtonKey’,

    iconCssClass: ‘mdi mdi-file-pdf’,

    enabled: true,

    action: function (item) {

    console.log(‘Export to PDF function works here’);

    },

    onUpdate: function (arg, item) {

    console.log(‘Something in viewer was updated, check/update button state here’);

    }

    };

    let url =

    ${process.env.REACT_APP_WEBAPI_URL}/api/reporting
    ;

        // eslint-disable-next-line no-undef
        var viewer = GrapeCity.ActiveReports.JSViewer.create({
            element: '#client-report',
            reportService: {
                url: url,
                securityToken: authHeader().Authorization
            },
            availableExports: ['Csv', 'Pdf', 'Xlsx'],
    
        });
        viewer.toolbar.addItem(pdfExportButton);
        viewer.openReport('clients.rdlx');
    }
    
    
    If I take out ```
    viewer.toolbar.addItem(pdfExportButton), the report renders perfectly!
    
    Can you help me understand why many methods are missing from the runtime that are described in the documentation?
    
    Here is a snapshot of the debugger: [img]https://gccontent.blob.core.windows.net/forum-uploads/file-34bde218-7211-45d7-8f9e-5021f83c2edd.jpg[/img]
  • Posted 14 April 2020, 9:24 am EST

    Hello,

    It is an internal feature as of now. We will release it in our next release i.e AR14 SP1 which is scheduled in May 2020. However, documentation is updated by mistake.

    Thanks,

    Mohit

  • Posted 14 April 2020, 11:33 am EST

    Thanks for the response.

    Is it possible to export with the current ar-viewer?

  • Posted 15 April 2020, 1:13 pm EST

    Hello,

    The export option is already present in the left panel of the JsViewer, Please refer the sample at the following location:

    https://github.com/activereports/WebSamples14/tree/master/JsViewerSamples/JSViewer_MVC

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels