Reply
 
LinkBack Thread Tools Display Modes
Old 09-06-2011, 10:57 PM   #1 (permalink)
Member
 
Join Date: Mar 2006
Posts: 58
AVIR is on a distinguished road
Default Adding data fields to a text box

In SI4.5 I was able to add datafields as a line item in a text box. This allowed me, for example, to put the manufacturer, model and product description on a single line instead of the two lines we have in SI5.5

I can't figure out how to do this.

In SI4.5 it was just adding {dtr:field} in the text box.

My goal is to put those three fields in a single line and have a second line used for client description for additional information on selected products.

I can't just use three different fields because they don't grow or shrink based on the size of the contained text in conjunction with one another.
AVIR is offline   Reply With Quote
Old 09-08-2011, 09:55 AM   #2 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 8
Prasad is on a distinguished road
Default 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
Prasad is offline   Reply With Quote
Old 09-08-2011, 03:46 PM   #3 (permalink)
Member
 
Join Date: Mar 2006
Posts: 58
AVIR is on a distinguished road
Default

Thank you. But I got this error:
Attached Images:
File Type: jpg error.jpg (14.8 KB, 5 views)
AVIR is offline   Reply With Quote
Old 09-09-2011, 09:14 AM   #4 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 8
Prasad is on a distinguished road
Default

Hi,

I found that there is some space automatically added between letters in the script after posted in the forum.
You try this below corrected script.

Code:
Sub grpItemHeader_Format

Dim Manufacturer As String
Dim Model As String
Dim Description As String

Manufacturer = ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHeader","txtManufacturer")
Model = ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHeader","txtModel")
Description= ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHeader","txtDescription")

ReportUtilities.SetTextBoxValue(rpt, "grpItemHeader","txtItemInfo", String.Format(“{0} {1} {2}”, Manufacturer, Model, Description))

End Sub
If you still get error, then you send your custom report to the support people by referring this forum post.

Thanks,
Prasad

Last edited by Prasad; 09-09-2011 at 09:19 AM.
Prasad is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:48 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.