Sub-Items

Other discussions about CSPro
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Sub-Items

Post by MrTaco »

Hi Guys

I have created subitems but not in a roster form, now i get this message(refer to the attached file),
when i create my form. your help will be highly appreciated.

Regards
Thabiso
Attachments
subitem.png
subitem.png (25.61 KiB) Viewed 8245 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sub-Items

Post by josh »

This is because you already have the item on the form. You can't have both the item and the subitem on the form. Remove the item and then drop the subitem on the form again.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

hey Josh i did that but it also doing the same thing, i think it only works on numeric than alphanumeric....
bcoz on numeric it works fine
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sub-Items

Post by josh »

Subitems work with both alpha and numeric. Make sure that the item isn't on any other form in your application.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

Please check the sample i did......
Attachments
Sub-Items.zip
(1.79 KiB) Downloaded 382 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sub-Items

Post by josh »

In the example you posted your subitems overlap so you can have only one of them on the form. Q1_1_1_LINE_ONE starts at position 3 and is 30 long and Q1_1_2_LINE_TWO starts at position 5 so it is occupying the same space in the dictionary. You can see this clearly if you look at the layout view in the dictionary editor.

The general rule is that if two variables on the form key to the same digit in the dictionary then only one of them can be on the form. So you can't have both the child item and the parent item on the form and you can't have two sub-items that overlap on the form.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

Hi Josh
Finally i managed

Thanks
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

Hi Guys

I have been trying to labels using:

PROC PERSON

setocclabel(PERSON,strip(PERSON_GENDER)))curocc());

but am getting this message:
ERROR: A multiply occurring group (or form) is expected near line 3 in PERSON procedure

what is it that am missing.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sub-Items

Post by josh »

The index needs be in parentheses after the group name i.e. PERSON(curocc()) and not after the label as you have it.

In addition setocclabel requires the group name (name of the roster) and not the name of the dictionary record. Without seeing your app I cant tell if PERSON is the group name but if you haven't modified the name in the forms tree then chances the group name is PERSON000. The code below should work but you will need to verify that PERSON000 is the group name by looking at the roster name in the form tree.
setocclabel(PERSON000(curocc()), strip(PERSON_GENDER));
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Sub-Items

Post by MrTaco »

Hi Josh here is the Application...
Attachments
GetLabels funtion.zip
(3.18 KiB) Downloaded 363 times
Post Reply