Showing posts with label filters. Show all posts
Showing posts with label filters. Show all posts

Saturday, February 25, 2012

Add filters dynamically

Hi,

I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.

The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.

I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.

Thanks in advance.

You can pass it as report parameter. But is must be done carefully to prevent SQL injections)

Add filters dynamically

Hi,

I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.

The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.

I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.

Thanks in advance.

You can pass it as report parameter. But is must be done carefully to prevent SQL injections)

Sunday, February 12, 2012

Ad hoc reporting Model and Security Filters

I am having some problems with creating security filters.

The way my system is setup is that I have a main table that contains all my data. I also have a security table that tells me what records each user has access to. I created an entity for my security filter and have a security filter defined that limits the data to the rows that have the logged on users id. This works fine if I look at the data I see the rows that are for the signed on user. Next I created a filter on my main table that limits the rows to the rows the user has access to. I did this by setting up another filter that says the UserCode from the main table must equal the user code from the security table. (I did this by right clicking and choosing edit as formula). This will then limit my data to the rows this user has access to. This all works but it is very slow. I captured the sql code that was running and noticed that the filter was doing a left outer join on my security table and joining on the unfiltered code then using a where clause to limit the data. When I run this logic it basically does a scan of my main table. If I change this join to be an inner join and join on the filtered data my results come back quickly.

Now to my question. Is this the way the system should work? Am I doing something wrong? Are there other ways to do this?

Thanks in advance for any help.Any success on the security filters? Mind sharing how do you exactly implement this? These security filters are really hard to understand and implement for me.

Ad hoc reporting Model and Security Filters

I am having some problems with creating security filters.

The way my system is setup is that I have a main table that contains all my data. I also have a security table that tells me what records each user has access to. I created an entity for my security filter and have a security filter defined that limits the data to the rows that have the logged on users id. This works fine if I look at the data I see the rows that are for the signed on user. Next I created a filter on my main table that limits the rows to the rows the user has access to. I did this by setting up another filter that says the UserCode from the main table must equal the user code from the security table. (I did this by right clicking and choosing edit as formula). This will then limit my data to the rows this user has access to. This all works but it is very slow. I captured the sql code that was running and noticed that the filter was doing a left outer join on my security table and joining on the unfiltered code then using a where clause to limit the data. When I run this logic it basically does a scan of my main table. If I change this join to be an inner join and join on the filtered data my results come back quickly.

Now to my question. Is this the way the system should work? Am I doing something wrong? Are there other ways to do this?

Thanks in advance for any help.Any success on the security filters? Mind sharing how do you exactly implement this? These security filters are really hard to understand and implement for me.