Click to See Complete Forum and Search --> : how to change content of page header setion in datareport


huang
July 24th, 1999, 12:16 AM
I use datareport in vb6.0. I want to change the text of label or textbox on page header section at run time,how to do it?

SparowHawk
July 24th, 1999, 12:09 PM
I have a very similar situation on an app I am developing now. I am using ADO without a Data Environment - just the Data Report. rsPrint is a recordset of a table in my dB. The way I modify a header label is with this sample code:

With rptDataReport
set .DataSource = rsPrint
.Sections.Item(1).Controls.Item(1).Caption = "This is a caption"
end with



Make sure the left hand side points to the label you want to change (controls.item(x) and (sections.item(x) is the header section). Also be very careful if you remove any controls from that section - the numbers will then point to different controls.

HTH,
Ken