How can I surpress a field on a report if blank, a good example of this would be a customer address Add1,Add2,Add3 where Add2 is blank so I want the address to move up by one.
Then you launch the function COMPRESSARRAY(StringArray)
And the empty dimensions will be removed from the array.
eg.:
COMPRESSARRAY(txtAddress)
Result:
txtAddress[1] will contain 'CompanyName';
txtAddress[2] will contain 'StreetName and Streetnumber';
txtAddress[3] will contain 'CityName';
txtAddress[4] will contain 'CountyName';
txtAddress[5] will contain 'CountryName';
Regards,
Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!
You can use the Format Address codeunit, like standard Navision. This will take care of all your needs. Take a look at the standard invoice report in the Sales Invoice Header OnPreDataitem trigger and the controls in the PageLoop Header (1) section to see how it works.
Comments
create a text variable and set the Dimensions property
eg.:
Name Type Length Dimensions
txtAddress Text 250 8
Next you can fill up the array with values.
eg.:
txtAddress[1] := 'CompanyName';
txtAddress[3] := 'StreetName and Streetnumber';
txtAddress[4] := 'CityName';
txtAddress[5] := 'CountyName';
txtAddress[6] := 'CountryName';
Then you launch the function COMPRESSARRAY(StringArray)
And the empty dimensions will be removed from the array.
eg.:
COMPRESSARRAY(txtAddress)
Result:
txtAddress[1] will contain 'CompanyName';
txtAddress[2] will contain 'StreetName and Streetnumber';
txtAddress[3] will contain 'CityName';
txtAddress[4] will contain 'CountyName';
txtAddress[5] will contain 'CountryName';
Regards,
...
Everybody on-line.
...
Looking good!
Tommy
RIS Plus, LLC