Dinamically change DataSoruce - Web Api Reports

Posted by: brezodejan on 13 July 2019, 2:46 am EST

    • Post Options:
    • Link

    Posted 13 July 2019, 2:46 am EST

    Hello guys,

    I am using Web Api Report and everything is working when I use flxr files on server with static DataSource connection to one database.

    Is there a way to change DataSource dynamically?

    If I use SSRS I do that with parameters… I pass parameters and change connection string and query at runtime.

    Is there the same way to do this, or maybe other better way?

    Thank you.

  • Posted 15 July 2019, 7:57 am EST

    Hi,

    We are still working on the issue. We will give you an update as soon as we have any further information.

  • Posted 15 July 2019, 11:47 am EST - Updated 29 September 2022, 10:48 am EST

    I think that you didn’t understand me… I don’t have any issue… I asked you how I can change DataSource programmatically? How to change database connection string? Hardcoded connection string in flxr file is not what I want. Is there any way to make connection string different without creating new flxr file with different file name.

    Thank you

  • Posted 16 July 2019, 8:33 am EST

    Hey,

    I apologize for the misunderstanding.

    The connection string of the report cannot be changed dynamically but you could add multiple DataSources with different connection strings in the FlexReport’s report definition file.

    Then you may use the OnClientQueryLoadingData event of the FlexViewer and pass the name of the DataSource accordingly. Please refer to the attached sample.

    CustomReportProvider.zip

Need extra support?

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

Learn More

Forum Channels