How to use a dataset in a query

i am trying to build a report that a user can customize. I am using the column selector under the reporting tab to let the user pick which columns to include in the query.

I am building a query this way, so any user can build the query used as the data keys in a report.

on my window i have:
popup calendar
column selector
and a report viewer

See photo for a better explanation


the data from the report viewer should look like the photo, but the columns in the column selector tool are output as a dataset not anything i can use in a query. any ideas how to easily get around this.

Hi

Unless I am misunderstanding what you are trying to do I think all you need to do is to bind the dataset for the report viewer to the out dataset of the column selector which will change when ever the user selects or deselects columns from the column selector

Aidan

I thought that also, but the dataset cant be used in a query, it can only be used once the query is finished, therefore cant be used to build the query.

I think I see what you’re going for here. Instead of placing that query binding on the report viewer, place it on the ‘Data In’ property of the column selector. You’ll want to change it so you include all of the columns a user might be interested in. Then you can bind the Report Viewer’s data property to the ‘Data Out’ property of the filter. That way, whatever columns the user selects from the filter are the only ones that make it into the report.

I have prepared the dataset with the data, binded it with Column Selector. The column selector seems to work ok, but the report viewer module itself does not show the data. I can not bind the columns directly since we have different reports and there is no exact amount of columns, all is dynamic.

Are there any ways not to define column names inside the report designer? Could the report viewer take column names and all the data from the Data out property of Column Selector to work with different amount of columns?

The only way to make the columns going into the report component dynamic is to alias all the columns in the query. But that still won’t let you have a dynamic number of columns in the report. It will be less work to create multiple reports with the different structures you need.