SQL Server Row Level Security with Telerik Reporting

2 posts, 0 answers
  1. Wei
    Wei avatar
    1 posts
    Member since:
    Feb 2018

    Posted 11 Dec 2018 Link to this post

    We are using the WebForms report viewer and I was wondering if there is a way to get SQL Server Row Level Security to work with Telerik Reports that have a SqlDatasource?

    Is there a way to execute SP_SET_SESSION_CONTEXT before the SelectCommand is executed?

  2. Ivan Hristov
    Ivan Hristov avatar
    232 posts

    Posted 14 Dec 2018 Link to this post

    Hello Wei,

    The reporting engine sends the contents of the CommandText property of the data source as a single SelectCommand, so it is not possible to execute another statement beforehand. However, a stored procedure that sets the session_context and then returns the data set should work.

    Another approach is to replace the SqlDataSource with ObjectDataSource and in its data retrieval method to execute the necessary commands to configure the row security and then fetch the data from the database.

    Ivan Hristov
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top