Re: Adding data fields to a text box
Hi,
You can combine three fields (Manufacturer , Model and Description) at the script side and assign it to a unbound textbox control.
To achieve this what you have to do –
1. Add three textbox controls bound to Manufacturer, Model and Description in to the corresponding section.
2. You can bind those controls by mentioning DataField property to “dtr:Manfacturer”,”dtr:Model” and “dtr:description”
3. Hide those controls by setting Visible property to False.
4. Add a unbound textbox control into that section and name it as “txtItemInfo”
5. For example sake let us assume -
• We have included 4 textbox controls in to the Group called “grpItemHeader”.
• Name for those controls are – “txtManufacturer”, “txtModel”, “txtDescription” and “txtItemInfo”
6. Include the following script code in the ”grpItemHeader_Format” event procedure
Sub grpItemHeader_Format
Dim Manufacturer as String
Dim Model as String
Dim Description as String
Manufacturer = ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHea der","txtManufacturer")
Model = ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHea der"," txtModel")
Description= ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHea der"," txtDescription")
ReportUtilities.SetTextBoxValue(rpt, "grpItemHeader","txtItemInfo", String.Format(“{0} {1} {2}”, Manufacturer, Model, Description))
End Sub
Publish the report.
Thanks,
Prasad
|