3

Expected: I need to get values coming from the dataset to put them in the header.

I've done some work around: -Create textboxs in the body area, populate them with the correct values coming from dataset. Get the values from the Header like this: ReportItems!txtFromBody.Value

No luck! The header is filled out with the correct information in the last page only.

I thought maybe I can use parameters, not sure at this point. Need some help!!

lcorteguera
  • 143
  • 1
  • 8

2 Answers2

0

Yes you can use parameter for header. 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();
yeasir007
  • 2,110
  • 2
  • 28
  • 43
0

Not sure which version you are using. In VS2010, you can bind data to header without problem.

neolei
  • 1,798
  • 2
  • 18
  • 32