I want to hide the datasource

Posted by: ducn on 24 February 2021, 3:01 pm EST

    • Post Options:
    • Link

    Posted 24 February 2021, 3:01 pm EST

    Hi team,

    https://www.grapecity.com/activereportsjs/api/modules/reportdesigner.html#datasourcetemplate

    How can I set canEdit = false for the datasource?

    Do u have any example?

    Thanks

  • Posted 24 February 2021, 8:21 pm EST

    Hello, Duc,

    Please take a look at the example of the pre-defined resources setup that you can find at https://www.grapecity.com/activereportsjs/demos/features/designer-resources/purejs

  • Posted 25 February 2021, 1:19 pm EST

    Hi as case :

    • I load the report by file: designer.setReport({id:url})
    • After loading the report, I want to hide the icon add and edit for ( datasource, dataset). Can reportjs support it?

    Thanks

    Duc Nguyen

  • Posted 25 February 2021, 10:29 pm EST

    Duc,

    There is no API that would allow you to hide the data panel, but I can offer you the brute-force solution. The data panel is just an HTML element, so you could hide by setting the CSS rules:

    .ar-data-panel .panel-group .panel:nth-child(1),
    .ar-data-panel .panel-group .panel:nth-child(2){
      display: none;
    }
    

    I posted the example in the code sandbox:

    https://codesandbox.io/s/hide-data-panel-njj8w?file=/src/App.js

    However, this is a short-term solution because we could change the UI structure in future versions and the CSS rules need to be modified accordingly.

    Do I understand correctly that you want to hide data binding details from the end-user? This is a valid scenario, so we should look at how we could bring this feature into the product.

Need extra support?

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

Learn More

Forum Channels