Page 1 of 1

Make Report Skip Blank Fields

Posted: Thu Nov 09, 2006 4:30 pm
by megs
I've made a custom report to print envelopes for selected vendors. I've edited the report so that the fields I've included look like this:
Name
Address
Address 2
City, State
Mail Code

I have 2 questions about this report:

1. When I come accross a vendor that has no Address2 I get a blank line where it would go. How do I get rid of it?

2.How do I get the State to follow directly after the City? Since not all city's are the same length, I've made the city field large and it often leaves a big space between the city and state fields.

Thanks for any help you can provide.

Re: Make Report Skip Blank Fields

Posted: Fri Nov 10, 2006 12:40 am
by NeilZ
megs wrote:I've made a custom report to print envelopes for selected vendors. I've edited the report so that the fields I've included look like this:
Name
Address
Address 2
City, State
Mail Code

I have 2 questions about this report:

1. When I come accross a vendor that has no Address2 I get a blank line where it would go. How do I get rid of it?

2.How do I get the State to follow directly after the City? Since not all city's are the same length, I've made the city field large and it often leaves a big space between the city and state fields.

Thanks for any help you can provide.
You should be able to right-click on the data item to get a menu with the Properties selection. Select that, then click on the Print When button that is there. On the next dialogue you'll see a checkbox where you can select to Remove Line If Blank.

Hope that helps

Re: Make Report Skip Blank Fields

Posted: Fri Nov 10, 2006 8:56 am
by Zorak
NeilZ wrote:You should be able to right-click on the data item to get a menu with the Properties selection. Select that, then click on the Print When button that is there. On the next dialogue you'll see a checkbox where you can select to Remove Line If Blank.
Neil is correct, this will remove the empty field *if* there is nothing to the right of that field on the report layout.

Name----------------------Vendor ID
Address1------------------Phone
Address2------------------Fax
City, State, ZIP-----------Contact person

If Address2 is blank, but Fax is not, you will still get a blank line for Address2.

Remove Line Box is Checked

Posted: Fri Nov 10, 2006 10:40 am
by megs
I have checked the Remove Line Box in the Print When dialog, but I'm still getting a blank line. I have no other fields or items on the same horizontal line as the field (thanks for the tip though). Here are my settings under properties (I have applied the same settings to all of the fields in my form):
ImageImage
I still get the following output that looks like this:

John Doe
Box 123

Anytown Anystate
Mailcode

Posted: Fri Nov 10, 2006 11:43 am
by Jeff
Make sure none of the text boxes overlap. If the address of city boxes overlap at all with the address2, the area will not be considered blank and not removed by the report writer.

One problem fixed...

Posted: Mon Nov 13, 2006 11:18 am
by megs
I tried everything I could think of to skip the blank line with no luck, so I reset the form and started over and now it works! I must have had some crazy setting wrong somewhere!

I'd still like to know if it's possible to put my city and state fields next to each other without all that extra space in between. Any suggestions?

How to put two fields together.

Posted: Mon Nov 13, 2006 2:15 pm
by megs
In case anyone else had this problem, this is how I got my city and state fields to appear next to each other:

Right click the field and click properties.
Click the ... next to expression
In the expression box enter the following: ALLTRIM(city)+", "+state

Now my output looks like this:
city, state

Posted: Mon Nov 13, 2006 2:43 pm
by Zorak
Yep, the ALLTRIM() thing is a life-saver. Most every text field you report on will be filled with spaces. Using that cuts the extra spaces off.