c# RDLC new Columns in ASPNET Forms page are empty

224 views Asked by At

I have a ASPNET Forms page that render a .rdlc report. My intention is to add 2 new columns in the SQL procedure used from report to show in page.

So, I update the procedure adding the new columns with success.

Querie result in SQL server

I chance the existing .xsd adding the 2 new columns with teh same name as the procedure SQL result.

enter image description here

So, I went to my .rdlc and I recriate my DataSet in Report Data

my DataSet in Report Data

In my .rdlc[Design] I add the 2 new Columns without problem. my .rdlc Design

When I run my website and render the .rdlc the page All columns are displayed with values except the new 2 columns. my website and render the .rdlc

My aspx and my aspx.cs don't suffer modifications because I didnt change everything like ReportPath, rsweb:ReportViewer , DataSourceId="ObjectDataSource1" .

I didn't understand why the new columns are empty and the others are returning data.

Some more information:

The aspx report bind data is devirated from the code above:

    <asp:Panel...>
                    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" HyperlinkTarget="_blank"
                        Width="816px" ShowCredentialPrompts="False" ShowDocumentMapButton="False" ShowParameterPrompts="False" InteractiveDeviceInfos="(Collection)">
                        <LocalReport ReportPath="The path of my .rdlc file" EnableExternalImages="True" EnableHyperlinks="True">
                            <DataSources>
                                <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="My DataSet name in Report Data" />
                            </DataSources>
                        </LocalReport>
                    </rsweb:ReportViewer>
                </asp:Panel>

 <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="[My DAO Method]" TypeName="[My DAO Class]">
                    <SelectParameters>

The [My DAO Method]" and "[My DAO Class] are working on page and returnig a list of My target Object

IList<TheObjectTarget>

I get in the Sql Profiller the Procedure that executes in [My DAO Method] with success in get the new columns.

The execution of the Report happening inside click event when I set the parameters, turns it visible, made a LocalReport.Refresh and enable Panel:

 ReportViewer1.LocalReport.SetParameters(param);
                ReportViewer1.Visible = true;
                ReportViewer1.LocalReport.Refresh();
                MyPanel.Visible = true;

Does anyone know?

1

There are 1 answers

0
Máster On

I had the same issue but I was using LINQtoSQL classes (dbml) and I had to refresh the reference to my stored procedure (deleted it and added it again from the dbml class). Maybe you'll have to do the same with your DataSource.