Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling white space if blank formula result

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I'm using Crystal 8.5 accessing an SQL database.

I have a database of patient visits. Patient visit information is entered by registration staff into the ADT. A report in the ADT uploads this information into abstracting software where staff code these visits. I have a Project with boolean fields for certain conditions in the abstracting software. For instance, if the postal code came across wrong from the ADT then they would flag field 1 of the project as true.

Now I'm creating a report to indicate what fields came across wrong so it can be sent back to the source. I've created a comment field per project field i.e. if {proj.fld1}="T" then "Ambulance date/time incorrect".

There could be more than one condition for Ambulance data so I created an ambulance field and entered:
{@comm1}+chr(13)+
{@comm2}+chr(13)+
{@comm3}+chr(13)+
{@comm4}

The problem is that the comment shows as above regardless of whether there aren't other conditions. For example, if there was a comment for 1 and 3 it would look like:
comment1

comment3

or just comment 4 would have 3 preceding blank lines. How can I control it so that blanks don't have blank lines returned. Thanks.
 
I would think that you would have to check for a null or blank fieldl before adding (since you are always adding a carriage return).
stringvar finalstring;
if {@comm1} <> "" then finalstring := {@comm1} + chr(13)
else if (@comm2} <> "" then finalstring := finalstring + {@comm2} + chr(13)
else if (@comm3} <> "" then finalstring := finalstring + {@comm3} + chr(13)
else if (@comm4} <> "" then finalstring := finalstring + {@comm4} + chr(13)
finalstring;

I believe the logic is correct. You may need a semi-colon after the last else statement.

I hope this helps.
 
Instead of using chr(13) to create returns, why not add each comment into its own detail section a to d, etc., and then format each section to "suppress blank section."

-LB
 
Hi

Thanks to you both for your comments - I like LB's approach but depending on how the other post is resolved i.e. how to only include two visits on one page, I may not be able to do it that way and may end up doing it the other way.

Thanks again!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top