on 05-14-2013 9:32 AM
Hi,
I want to display 3 fields of the table by comma separated in my crystal report.
For e.g. Add1,Add2,City
if any one of the of them is blank then suppress that comma.
if Add1 is blank the want to display Add2,City.
If Add2 is blank the display Add1,City &
if both Add1 & Add2 is blank then display only City.
Please help on this.
Thanks & Regards,
Deepali.
Hi Deepali,
Create a formula with this code:
local stringvar array addr1;
local numbervar i;
addr1 := [{Add1},{Add2},{City}];
local stringvar addr2;
for i := 1 to ubound(addr1) do
(
if not(addr1[i] = "") then
addr2 := addr2 + addr1[i] + ", ";
);
left(addr2,len(addr2)-2);
While in the Formula Editor, look for an option called "Exceptions for Nulls" on the top. Change that to "Default Values for Nulls".
Let me know how this goes.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.