Skip Text Fields with Blank text

Sina
Member Posts: 33
Hey everyone.
I have 7 text boxes with labels for outprinting vehicle data one under another in a report. When the text in the first textbox is blank, I want to skip the first textbox and take the second one. If the second one is not empty it should take place in the place of the first textbox, but when the second textbox is blank, too, it should skip to the third textbox...and so on...
Does anybody know how to realize this? :-k
Thank you.
I have 7 text boxes with labels for outprinting vehicle data one under another in a report. When the text in the first textbox is blank, I want to skip the first textbox and take the second one. If the second one is not empty it should take place in the place of the first textbox, but when the second textbox is blank, too, it should skip to the third textbox...and so on...
Does anybody know how to realize this? :-k
Thank you.
Sina
0
Comments
-
I assume you are talking about a report. You could use a lot of sections and toggle the SHOWOUTPUT but I would add TextConstants for the labels, add an array of equal text variables and then assign each value to the corresponding array element and assign this to the textbox...0
-
Yes I created an array called VehicleData for the text box and VehicleText for the labels. But what I don't know is how to realize to skip the blank textbox and take the next one with a text within...Sina0
-
Try using Function COMPRESSARRAY
Harjot0 -
If you have 10 textboxes then you can:
textbox1 -> SourceExpr = textArray[1]
textbox2 -> SourceExpr = textArray[2]
.
.
.
textbox3 -> SourceExpr = textArray[3];
If you have empty array elements in the middle then you can do
COMPRESSARRAY to move all values at the beginning...0 -
It works fine for the text boxes, thanks. Do you know how to use this for the labels? Because the labels are never empty and when the textboxes are empty, the labels should be empty, too.Sina0
-
change the labels into text boxes and place them in an array too0
-
That's not possible, because there is still a text inside the label and when it would be a textbox that wouldn't change anything. That's the problem...Sina0
-
Hi
I think you should use the SHOWOUTPUT as suggested by kapamarou.
Create Seven Sections one for each Textbox and in OnPreSection trigger use
CurrReport.SHOWOUTPUT(VehicleData[1] <> '');
Change the Number of Arrayvalue for each Section
Harjot0 -
you can decide whether to populate the label [changed into a text array as I suggested] on whether or not the corresponding text has anything in it, unless I misunderstand your requirement?0
-
Problem solved, thank you. When the textboxes are empty I changed the content of the labels into empty (:= '') and at the end used COMPRESSARRAY for the array of the labels.
\:D/Sina0 -
SHOWOUTPUT doesn't work with this because I have more textboxes in one section which I cannot set to SHOWOUTPUT(FALSE), it works fine now. Thank you.Sina0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions