Issues with the ReportViewer control in Angular2

Posted by: kevin.krohn on 12 March 2018, 5:23 am EST

    • Post Options:
    • Link

    Posted 12 March 2018, 5:23 am EST

    I have an Angular2 application that is served by the same web app that I use to for my webapi and serve the FlexReports. My issues are as follows:

    1. This is an intra net application that uses windows authentication. This causes issues when trying to call the report api menthods as no authentication header information is passed. Is there anyway to add headers to the calls?

    2. Since I am using one web app to serve the client as well as the server api, it can’t find the reports due to, I assume, the routes falling back to my angular client. Can I modify this behavior or do I have to setup a separate report server?

    3. I would like to be able to change the datasource for the report but I can’t find any documentation on modifying the report on the server to change the connection string to the database. How do I do this?

    4. I need to pass a list of ids into the parameter for the report. How do I do this with the report viewer? Can I create a custom report controller to handle this and issue #3?

  • Posted 12 March 2018, 9:09 pm EST

    Hi Kevin,

    This issue requires investigation. We will update you tomorrow.

    ~Manish

  • Posted 13 March 2018, 3:35 pm EST

    Hi Kevin,

    You may inject token into XMLHttpRequest using one of the library:

    https://www.npmjs.com/package/fs-jwt-xhr-hook

    https://github.com/AlbertFazullin/fs-jwt-xhr-hook

    It may be used like follows:

    
    var hook = new TokenHook();
    hook.installHook(/^http:\/\/demos.componentone.com\/ASPNET\/c1webapi/, function(xhr) {
      if (xhr.readyState == 1) {
          xhr.setRequestHeader('Authorization', 'token');
      }
    });
    
    ...
    
    <ReportViewer initialization>
    
    

    Since I am using one web app to serve the client as well as the server api.

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    As we understand, you have WebApp to provide Report information to the SeverSide and ClientSide. If yes, there should not be any issue. Please refer to the following demo sample which provide various C1 Services to be consumed in projects.

    http://demos.componentone.com/aspnet/webapiexplorer/

    You may change DataSource at runtime using CustomReportProvider, please refer to the following blog for the same:

    https://www.grapecity.com/en/blogs/asp-net-mvc-reporting-with-componentone-report

    Please refer to the attached sample to setting Parameter for ReportViewer in code. (Wijmo) . If you would like to set parameter for MVC ReportViewer, please refer to the following demo sample (Setting Parameters in Code Section -at last)

    http://demos.componentone.com/aspnet/reportviewer101

    Please let us know for any further query…

    Thanks,

    Manish Kumar Gupta

    ReportViewer_parameter.zip

Need extra support?

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

Learn More

Forum Channels