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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help? Please? 1

Status
Not open for further replies.

kevinbellnj

IS-IT--Management
Apr 15, 2004
11
US
I am VERY new to Crystal and also new to using Goldmine but responsible for getting some basic reports running.
I'm working with CR 8.5 and Goldmine 6.5 and they have a real lack of technical information regarding how to use both together.

I need to learn how to put together some strings that will allow me to group several pieces of information together and eliminate any fields that me be empty, blank, null...

The example below is from one of the reports that we had used in the past that had worked and included the company name, Address, city state zip etc...

The problem I am having is that when I run the report I get nothing returned for any of the records. A little research has given me the idea that it is because one of the fields is blank in most cases.

Can anyone give me a place to start here? Any links or docs going over this issue would be very helpful...

Thanks.

KB






StringVar sFullAddress:='';
StringVar sCompany:= {Contact1.COMPANY};
StringVar sAddress1:= {Contact1.ADDRESS1};
StringVar sAddress2:= {Contact1.ADDRESS2};
StringVar sCity:= {Contact1.CITY};
StringVar sState:= {Contact1.STATE};
StringVar sZip:= {Contact1.ZIP};

if sCompany='' then
sFullAddress:= sFullAddress
else
sFullAddress:= sFullAddress + chr(13) + chr(10) + sCompany;
if sAddress1='' then
sFullAddress:= sFullAddress
else
sFullAddress:= sFullAddress + chr(13) + chr(10) + sAddress1;
if sAddress2='' then
sFullAddress:= sFullAddress
else
sFullAddress:= sFullAddress + chr(13) + chr(10) + sAddress2;
if sCity > '' and (sState > '' or sZip > '') then
sCity:= sCity + ', ';

sFullAddress + chr(13) + chr(10) + sCity + sState + ' ' + sZip;
 
You might want to try a different approach and add the fields to separate detail sections:

da: {Contact1.COMPANY}
db: {Contact1.ADDRESS1}
dc: {Contact1.ADDRESS2}
dd: {@citystatezip}//where this formula is:

{Contact1.CITY}+", "+{Contact1.STATE}+" "+{Contact1.ZIP}

Then go to the section expert (format->section) and for each of the detail sections check "suppress blank section."

-LB
 
Thats a valid and appreciated tip however, I have a formatting problewm in that that is only and example of the data. I have about forty pieces of field data to fit on 1/2 page of a report and I don't believe I can accomplish that by using seperate details. The report is more of detail report for one record. Thanks for the input but I was trying to accomplich this via formula...
 
Place a text object on the report (Insert > Text Object)

Drag and drop the fields into the text object, pressing enter when you want to start a new line.

Right Click on the text object, Format Text, check the box next to Suppress Embedded Field Blank Lines.

With regard to blank fields, if a field has a NULL value, you must check for this within a formula, otherwise the result of the formula will be NULL.

If IsNull({field}) then (do something) else (do something else)

The ISNull check has to be the first thing you do in the formula.

Hope this helps...

Reebo
UK

Please Note - Due to current economic forcast and budget constraints, the light at the end of the tunnel has been switched off. Thank you for your cooperation.
 
Dear Kevin,

Try this instead (replacing the field names with your field names):
Code:
StringVar sFullAddress:='';
StringVar sCompany:= If isnull({Customer.Customer Name}) 
                    or {Customer.Customer Name} = '' 
                    then '' else {Customer.Customer Name} ;
StringVar sAddress1:= If isnull({Customer.Address1}) 
                    or {Customer.Address1} = '' 
                    then '' else chr(13) + {Customer.Address1} ;
StringVar sAddress2:= If isnull({Customer.Address2}) 
                    or {Customer.Address2} = '' 
                    then '' else chr(13) +{Customer.Address2};
StringVar sCity:= If isnull({Customer.City}) 
                    or {Customer.City} = '' 
                    then '' else chr(13) + {Customer.City} + ', ';
StringVar sState:= If isnull({Customer.Region}) 
                    or {Customer.Region} = '' 
                    then '' else {Customer.Region}+ ' ';
StringVar sZip:= If isnull({Customer.Postal Code}) 
                    or {Customer.Postal Code} = '' 
                    then '' else {Customer.Postal Code};

StringVar sFullAddress:= scompany + saddress1 + saddress2 + scity +sstate +szip

I don't know why they did the formula the way they did originally, because they already had variables set up they could test the value and set it in the variable for each field itself.

Now, for those other fields follow my example above to add those additional fields you mentioned. If you give us an example... we might be able to help a little more.

Regards,

ro


Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Thanks Ro! That worked out great. However (and please, excuse my ignorance)- How might I add in a text description to the field data? For example in the actual report, I have legal company name, their DBA or "Doing business as" and AKA or "Also know as" as three seperate fields. Listing them together leads to some confusion so it is necessary to insert a description of the field data like: "Company", "DBA" and "AKA".

Some of the customers have no DBA or AKA so that it where the isnull statement comes in handy... Any help would be greatly apppreciated!!!!

Thanks again..

KB
 
Nevermind, I figured the rest out - thanks everybody!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top