12-05-2016 06:57 AM
Hello,
I'm building some report which shows values from my feature.
Depending from feature they have some categories (boolean column in feature table) assigned to them and by those categories I have made some visibility option to form tabs.
Now when generating report I have problem to make some part of report to be invisible, depending from categories assigned into feature. I managed to make textboxes with static labels visibility dependency using binding in telerik:
Visible = IIf(Fields.FORM_KAT1=1,true,false)
But this trick doesn't work on fields with "Fields.FORM_xx" like values. I get error inside PDF's :
An error has occurred while processing TextBox 'textBox29': The expression contains object 'FORM_WOREK' that is not defined in the current context
As far I understand my problem, telerik doesn't get variables from form tabs which were made invisible by atrribute filter.
In FormSetting.xml I use visible setting like this (Variable 'KAT1' has to be '1' to make tab visible):
<FormTab name="ED_STANPPOW_Tab" label="Zasoby przeciwpowodziowe" visible="form[SQL[Select KAT1 from MAGAZYN where ID = {FORM.ID} and KAT1 = 1]]">
Is there any other option, to make my tab hidden, not disabled, to make my report work properly? Or some other way to disable parts of report without getting error about missing variables?
I've found some tip here: http://smartclient.intergraph.at/documentation/JavascriptConditions but it doesn't work in GMSC 2015.
visible="hidden[SCRIPT[IG.eval((({FORM.KAT1} === "1")]]"
12-05-2016 09:05 AM
Hi,
could you please try with something like
visible="hidden[SCRIPT[_.isEqual(IG.getItemById('FORMFIELDNAME').getValue(), '1')]]"
Regards,
Stefano
12-06-2016 01:24 AM - edited 12-06-2016 01:25 AM
Hi,
I tried with this:
<FormTab name="PPOZ_Tab" label="Zasoby przeciwpożarowe" visible="hidden[SCRIPT[_.isEqual(IG.getItemById('KAT2').getValue(), '1')]]">
Now I can see all tabs and they are like inactive (grayout and unclickable)
12-06-2016 02:17 AM
Hi,
please try by doing it in a custom script. Something like (using the correct condition):
if (!_.isEmpty(IG.getItemById('PARCEL_ID').getValue())) { IG.getItemById('MyTab').show(); }
if needed, you can subscribe to the event related to the field:
IG.vent.on('form:ready', function (form) { form.getItemById('PARCEL_ID').value.subscribe( ... CALL HERE ...); }
For any errors please refer to the JS console.
HTH,
Stefano