Alpha Video Training
Results 1 to 18 of 18

Thread: Conditional Object

  1. #1
    Arthur Casse
    Guest

    Default Conditional Object

    I'm creating a conditional object in a letter form which states:

    iif(Ship="Y",Shipname,iif(isblank("Title"),Trim(First_Name)+" "+Trim(Last_Name),Trim(Title)+" "+Trim(First_Name)+" "+Trim(Last_Name)))

    When I click on the Evaluate Button, it shows the correct information but when I try to give it a Label name it states the error message "Filter Expression Not Logical".

    It worked in A4! Any suggestions?

    Basically it checks the character field "Ship" for a Y to then put in the shipping name. If its a N, then it uses the Title, First_Name and Last_Name character fields for its information. All the fields in the expression are character fields.

    Thanks!

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Arthur,

    The expression seems valid to me which explains why the expression builder accepts it. However, it is not a *logical* expression, that is, it does not evaluate to logical .t. or .f. You correctly state that it yields a string the contents of which are conditional upon the values of "ship" and "title."

    You do not state where you want to use the expression but it seems as if you want to use it to define a condition in the properties of a conditional object. In this place you indeed need a logical expression such as

    ship=.t. .and. isblank("title")

    In other words, you build the condition into the layers of the object rather than into the string to be displayed.

    Of course, you could dispense with the conditional object and define a calculated field which you define with the expression in your post. That way you would have your contionality without a conditional object.

    Bill

  3. #3
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Bill,

    I created Calculated Fields and it appears to work except for two problems:

    1. Its showing the records twice in the letters (two letters for each record)

    2. And if there's no Company name, it shows a blank line. That was one of the reasons I was interested in a Conditional Object to remove the blank line if there was no Company name.

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Arthur,

    For things like address blocks you should look into a rich text object. I could run it down for you but I would just be repeating the clear instructions you will find in the manual.

    It shows how to make a soft line break so that blank fields (like your company name) will not leave spaces.

    Note that (at least on reports) you can place a rich text object on a layer of a conditional object. And you can define a calculated field and place it in a rich text object. It is easy to appreciate that, in combination, these three devices provide tremendous flexibility.

    I use them to output multiple bibliographic formats which must accomodate many more conditionalities than even the most complicated address.

    So press on.

    Bill

  5. #5
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Bill,

    Unfortunately, even though I have the complete manual printed out, I'm still having a problem understanding those clear instructions you speak of. Do you know of anywhere on the Internet that may show a graphic explanation of it?

    Thanks for your input.

  6. #6
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Arthur,

    You wrote, "Do you know of anywhere on the Internet that may show a graphic explanation of it?"

    Yes, I do. Right here.

    Frame a specific question and someone will answer. If all else fails attach a sample file.

    For the present issue, why not step back and frame a statement of the problem. As I understand it you want to print an address in a letter. You want it to be the address fields in the ship to fields of your table. But if ship to is false then you want to send to some other address fields. In these fields, company may be blank and if so then you want the layout to adjust.

    If I am approximately correct, create a conditional object.
    The expression of the first layer is
    ship = .t.

    Place appropriate fields on this layer.

    The second layer has an expression of
    Ship = .f.

    On this layer place a rich text object. Place your fields on this object and put company on a separte line. Separate the address lines by "ctrl-enter" rather than a simple "enter" to ensure that any blank lines will be supressed.

    If missing fields are a possibility you may want to use a rich text object on layer 1 as well.

    Does this get you started?

    Bill

  7. #7
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,312

    Default RE: Conditional Object

    Arthur, I think my friend Bill meant SHIFT ENTER, not CTRL ENTER.

    The former creates a soft line break and prevents the blank space if a field on a line in the rtf object is empty. The later inserts a page break, which would appear on screen as a dotted line.

    Rich text objects are explained pretty thoroughly in chapter 9 of the User's Guide, beginning at pg. 123

    -- tom

  8. #8
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Bill,

    I changed the Ship character field to a logical field. I then created a conditional object based on Ship=.f.

    I then created a Rich Text Object and placed the name field and company field below it separated with a Shift Enter for a soft return.

    When I view the letter form, company names are at the top of the letter head and names are at the bottom of the letter head.

    I'll keep trying to figure this out - thanks for your help!

  9. #9
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Thanks Tom

  10. #10
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Progress is slow but I am making progress. I have converted my Ship field back to a character field and created calculated fields which I have placed in my Rich Text Object. They appear to be working well with the expection the Rich Text Object moves down the page with each passing record. Any way I can make that stay in the Letter Head area ?

    Thanks!

  11. #11
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,312

    Default RE: Conditional Object

    If your 'top of page' is drifting, you might embed a page eject (form feed) in a page footer. There are probably more elegant ways to force the next page to begin at top but this has worked for me before. -- tom

  12. #12
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Tom,

    Are you referring to the Page Break from the Tool Box? If so, I've been trying to put it in the Page Footer but its not staying. Must I put it in some type of Rich Text Object?

    Also, just to let you know, I am having success with conditional Rich Text Object in both the Letter Head and the body of the letter!

    Thanks!

  13. #13
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Tom,

    This letter is for and 8 1/2 X 11 sheet of paper. I noticed in the design mode that if I dragged the bottom of the sheet to make it an 8" length, I get my page breaks.

    Your thoughts on this please!

  14. #14
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Tom,

    I've been able to maintain my top of page by transferring my information from the Letter Head to a Page Header and then removing the Letter Head. The only problem I have now is when I Print Preview the letters, the body of the letter slowly creeps down with each page viewed.

    Any suggestions on that? I have a Page Header, Body and Page Footer.

    Thanks again!

  15. #15
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Tom,

    Your friend Bill did indeed mean ctrl-enter. Apologies Arthur.

    Bill

  16. #16
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Yikes! Shift-enter. I'd better reboot.

  17. #17
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Conditional Object

    Arthur,

    I haven't done much with letters so I am not going to be much help in that department. However, remember that margins count as part of the page size and if you have sections (at least on reports) and you have not checked the "allow shrink" property the sum of the sections can add up to more than the page length.

    In general, I like to tighten up the vertical dimension of a section and allow it to expand as necessary.

    You might want to use the search feature of this board to find threads which deal with having letters start where they should. I remember reading them. For sure, plenty of users have confronted this problem and resolve it.

    Keep on truckin'
    Bill

    {Shift-enter} {shift-enter}

  18. #18
    Arthur Casse
    Guest

    Default RE: Conditional Object

    Bill,

    Thanks for your input. I'll do a search and check the messages!

Similar Threads

  1. Tabbed Object vs. Conditional Object
    By Tom Cone Jr in forum Alpha Five Version 6
    Replies: 26
    Last Post: 02-28-2005, 10:23 AM
  2. Conditional Object ?
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 6
    Last Post: 05-08-2003, 04:16 PM
  3. Conditional Object Trouble...
    By Dale Bradt in forum Alpha Five Version 5
    Replies: 6
    Last Post: 02-24-2003, 06:00 AM
  4. Conditional object
    By Jane Fortier in forum Alpha Five Version 4
    Replies: 1
    Last Post: 05-31-2001, 09:37 AM
  5. Conditional object and field value
    By Steve McCourt in forum Alpha Five Version 4
    Replies: 4
    Last Post: 05-24-2000, 12:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •