Link to home
Start Free TrialLog in
Avatar of mfreeman2
mfreeman2

asked on

How do I make new columns display on an rdlc report?

I have manually edited an rdlc report script to add 3 new columns to the rdlc report. I did this by making sure the data retrieval query contains the columns and by
manually adding a <fields></fields> entry for each new column in the rdlc script. The new columns do not display on the report but rather a blank space shows on the report where the new columns should be. I searched Google and determined that I may need to rebind the data source. However, all the information on rebinding that I found uses a report design tool. How can I rebind the new fields without using a report design tool?
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Ideally, for any RDLC changes, you would extract or download the current RDLC, make the changes in BIDS/Visual Studio and then redeploy the rdlc files with the changes. This is the default approach which is easier to modify rdlc and test it as well.
And the approach you are asking for is to edit the RDLC file in xml format which honestly I have never did..
Kindly let us know the reasons behind choosing this so that we can guide you accordingly.
Avatar of mfreeman2
mfreeman2

ASKER

Hello Raja,

The reason for choosing this is I am assigned the task of adding columns to the rdlc report but we do not have the report designer tool. I have made other changes to rdlc reports such as adding table cells to display text and data columns that were already a part of the data
source and I did this by editing the rdlc xml file. The difference here is I had to add new columns to the data source by adding them to a view
that the report uses in the data source. I have searched the internet for answers and the search results generally say that after adding new columns to the data source, a re-bind of the data source is needed to make the new columns display on the report. Then instructions are given on how to re-bind the data source using the report designer tool. I do not have the report designer tool and therefore can not re-bind using the tool. I need a way of re-binding the data without using the report designer tool or another work around for getting the columns to display on the report. The new columns are coded in the xml file but they currently display a blank cell on the report.

Thanks,
Morris
Ouch, you're manually changing the xml report definition? That's kind of a recipe for disaster - they're very finicky. You're much better off downloading the free report designer:

Microsoft Rdlc Report Designer for Visual Studio
I have some new information on my problem that was not mentioned earlier. The report uses data generated by a stored procedure as the data source. I modified the stored procedure to add the new columns and now realize that it may be that I need to re-bind the stored procedure, if that makes sense. Is there a way to rebind a stored procedure.
>> I modified the stored procedure to add the new columns and now realize that it may be that I need to re-bind the stored procedure, if that makes sense.

Yes, it makes sense as with any column changes in the query or stored procedure, we will refresh the rdlc so that it will binds all input and output columns properly..
But honestly I don't know how to refresh with your method of changing the XML directly.
I would request you to install SQL Server Data Tools which is available for free and then edit your RDLC safely without any issues.(you can also use the tool suggested by Russell but I would prefer SSDT)
https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017
ASKER CERTIFIED SOLUTION
Avatar of mfreeman2
mfreeman2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the update, Morris..

Kindly request you to close the question by accepting your last comment as solution and any of our suggestions if those helped as Assisted solutions.
>>and the feedback of other experts as Assisted solutions.

That seems to be awarding participation points.  I would suggest deleting this because I don't see the solution benefiting the Knowledge Base.
>> That seems to be awarding participation points.

Okay, if that is the case, then remove the assisted solutions but request you to keep this solution as reference as it proves that we can modify rdlc file directly and achieve any changes to a report.. Obviously this is not the recommended best practice and hence I've shared more to me and Russell.
Assuming it isn't common knowledge that you can manually edit a text file and things still run, I have no problem with that suggestion.