Suppose I have an StoredProcedure that returns a unique row corresponding to a table with columns "Name" and "Surname".
I want the report to show:
Name: NameField
Surname: SurnameField
Where the "NameField" and "SurnameField" are the fields returned by the StoredProcedure.
The special requirement, is that if "SurnameField" is empty or null, then I don't want to show the "Surname: SurnameField".
How can I achieve this?
The only thing that I thought is breaking the storedprocedure in two, one for Name and one for Surname, and dividing each line in different subreports and selecting "Delete if empty" (or something like that) for the second... but this is really overkill, I guess there's an easier way.
Should be quite a few ways of achieving this. I'm not quite sure how your report is laid out but you can surpress the field and label or entire section (if it has it's own) using a simple formula; isnull({table.field}) or {table.field} = ''
Or if you have set nulls to be treated as defaults rather than exceptions you can simply do: {table.field} = ''
L
Set the field > 1
(assuming all is greater than 1 already) or <> 0
.
That should filter out records with a blank in that area.
You can achieve it by Section Expert:
Supposing the name field name is Surname and the table is NAME and the field storing the value of surname is S_NAME_VALUE. You can put up the filter checking if the value is NULL or BLANK.
if {NAME.SURNAME} in ['SNAME'] and
{NAME.S_NAME_VALUE} =''
then
TRUE
I am assuming there are some codes for Surname filtering i.e SNAME.
If not you can use the one condition and mark it as true.
if {NAME.S_NAME_VALUE} = '' then TRUE