Domanda

Fairly new to CR and i am looking for some help,

Basically I want to show my address in a text box containing the fields as follows

{Company}
{AddLine1}
{AddLine2}
{ZIP} {City} {State}
{Country}

I have these all displaying properly in the text box when all fields are entered in the database. The real problem is in the zip, city, state line. I need to space these to keep them separate so i have simply inserted a space in between each one, but the spaces show up when the ZIP field is not filled in the database and the city field then is indented in preview. The ZIP is suppressed if not entered so that is not the problem, just the spaces between zip, city and state. Is there anyway of diplaying the spaces when they are entered so that the address is spaced correctly, but also not displaying the spaces when a field is not entered so that this line is not indented? I think it may be a formula i need for this? Maybe something like this?

If IsNull ({customer.ZIP}) Then
{customer.CITY} + " " + {customer.STATE}
Else
{customer.ZIP} + " " + {customer.CITY} + " " + {customer.STATE}

Thanks for the Help, Much appreciated

È stato utile?

Soluzione

Maybe these crystal reports syntax tips could help you (in the designer)

IsNull({Produits.Couleur})
InStr({Produits.Couleur}, " ") = 0

Some functions are build to have better formatting relative to context fields which are null:

PreviousIsNull, NextIsNull.

Some docs could help you like complete syntax reference for 8.5 (2011, pdf).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top