How to link data coming from a dataset to a header in rdlc reports?

Expected: I need to get the values ​​coming from the data set to put them in the header.

I did a little work: -Create text fields in the body area, filling them with the correct values ​​coming from the data set. Get the values ​​from the header as follows: ReportItems! TxtFromBody.Value

Bad luck! The title is filled with the correct information only on the last page.

I thought maybe I can use the parameters, not sure about that. Help is needed!

+3
source share
2 answers

Yes, you can use the parameter for the title. enter image description here

Now add parameter

// Add Parameter 
            List<ReportParameter> parameters = new List<ReportParameter>();
            parameters.Add(new ReportParameter("AccountName", accountName));
            parameters.Add(new ReportParameter("AccountCode", "Account Code: " + accountCode));
            parameters.Add(new ReportParameter("UnitName", unitName.ToUpper()));
            parameters.Add(new ReportParameter("UnitAddress", unitAddress.ToUpper()));
            parameters.Add(new ReportParameter("Title", "Schedule"));
            parameters.Add(new ReportParameter("Date", dateVal));
            ReportViewer1.LocalReport.SetParameters(parameters);
            ReportViewer1.ShowParameterPrompts = false;
            ReportViewer1.ShowPromptAreaButton = false;
            ReportViewer1.LocalReport.Refresh();
0

, . VS2010 .

0

Source: https://habr.com/ru/post/1770110/


All Articles