Reputation: 568
As i understand, SSRS automatically generates a Table's Columns based on the initial DataSet fed to it. However, if i modify this DataSet's query and add 1 or more new column/s, how can i have SSRS to update the table and include these new column/s?
Say for example:
Original Query: | First Name | Last Name | Gender | Address |
Modified Query: | First Name | Last Name | Age | Gender | Current Address | Present Address |
Is this possible, or do i have to go around it manually?
Upvotes: 0
Views: 1777
Reputation: 349
Is your query a Stored Procedure? (I think this also works if you have SQL embedded in your dataset) If so, if you double click the updated dataset in Visual Studio, the Dataset Properties window will pop up. Click the "Refresh Fields" button under the Stored Proc name (or the SQL text box), and it should pull in the new columns/fields into the dataset. Clicking on the "Fields" link on the left should show you all of the Fields/columns available to you from the query, and after clicking the Refresh button, you should see your new ones displayed too. NOTE: The fields are not always shown in the same order in this window as they are listed in the query, but you can reorder the fields within the Properties window
You can then add new columns to the report Tablix and add the new dataset values to those Tablix columns.
Upvotes: 0
Reputation: 476
SSRS automatically generates a Table's Columns based on the initial DataSet fed to it
This true if you are creating a new report and using the report wizard.
If you do not want to redo the report, you need to add those columns manually into the table. Select an column and right click on the very top box of the column should give you an option to "add column" either to the left or right, then you put your new columns into the textbox.
Of course, the other way is to just redo the report through your report wizard with the new query and it will do all that for you. I'd go with the first option.
Upvotes: 1