INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Formula Help

User Function Library Creates Duplicate Output by chelseatech
Posted: 13 Jun 04

User Function Libaries (UFL) are supposed to be stateless.  That means that it starts with some values, does all the processing required and then finishes it's work. The next run of the formula doesn't remember the values from the previous run

However, you can write a UFL that does remember state, and you can use a series of functions inside formulas to build disk files, write XML documents, send email to a SMTP server, etc. We have several of these already written and available from our web site.

An occassional problem occurs with these.  It appears that the UFL is processed more than once, but only every now and then.  Discussions with CD revealed that this is because the section is processed, formatted and then checked to see if it will fit on the bottom of the page.  If it doesn't fit, the page footer and header are processed, and the section is reprocessed for the top of the new page.

To remove this problem do the following...

1.  Write the report that uses your UFL functions in formulas.

2. Create a section above the section where you do all the work, Details (a).  This section must have a height, and canÆt be suppressed or set to Underlay.  Using Underlay, Suppress or Suppress Blank Section on this section all cause duplicate records.

3. Create a set of formulas as followsà
Reset Counter:  Place in RH and PF sections
  WhilePrintingRecords;
  global numbervar c:=0

New Line: Place in the Details (a) section.  
  This can be formatted with ôSuppressö
  WhilePrintingRecords;
  global numbervar c:= c + 1

4. Set a conditional ôNew Page Afterö on Details (a)
  WhilePrintingRecords;
  global numbervar c;
  c >= 60

Back to Business Objects: Crystal Reports 1 Formulas FAQ Index
Back to Business Objects: Crystal Reports 1 Formulas Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close