×
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!
  • Students Click Here

*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.

Students Click Here

Jobs

Report Form?

Report Form?

Report Form?

(OP)
Hi,
I have a table with 4 fields, and thousands of records. using VFP 9 SP2
field name
--------
1:code
2:amount1
3:amount2
4:amount3
the table indexed on code
in the report designer, in the group header 1:code
I have this expression ..IIF(_PAGENO = 1,amount3 + amount2 - amount1, ' ')
the report is working very fine no problem.

My question is: I want to display the same value of the above expression, in the group Footer 1:code
although the cursor now on record 100 with same code different values of amounts.
Is this possible? Or is there a way to do it differently in the report?.

best regards

RE: Report Form?

JRP11,
Yes, this is no problem. One thing you can do is just before you issure the command:
REPORT FORM <formname> TO <destination>
Issue this:

SELECT <TABLE>
SET ORDER TO <CODE>
GO TOP
lnCodeFooter = amount3+amount2-amount1

Then in your report forms footer, in the field expression just put in:

lnCodeFooter

Note that any value I've put in <...> means you just put in the name of the table or index you have, since I don't know the name of those values.

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Report Form?

Also, remember to make sure that in the report properties dialog box, you have "Private data session" turned off (unchecked) in the Data Environment tab at the bottom.

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Report Form?

You could do as Scott suggests, I don't know if you literally meant the value of the expression of the top record, though.

In a group footer I'd expect the sum or some other aggregation, for that you use report variables, take a look into them, you can reset them to 0 in each group and sum or do other aggregations. That's more likely what you need. I also wonder strongly about limiting the expression specifically to page 1 of the report. If you really want this to only print on page 1 then what if the first group is longer, what for the first group spanning to page 2 and why suppress this for all further groups on page2 onwards.

Even if I assume this report to start groups on a new page, the real intent is to only print this for the first group and rely on it only spanning one page always, might be sensible, but there are more direct ways to do this. For printing or not there is the printwhen expression of report controls and to only print the first group you'd initialize a variable to the group value and not reset that variable with every new group, so it stays that value throughout the whole report. Then printwhen: groupvalue == reportvariableinitedonceonlytothefirstgroupvalue

That way you print something for the first group only no matter how many pages it spans.

Also set "remove line if empty, if the control is standalone in a line, this will then condense further detail bands and not leave a gap line.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: Report Form?

(OP)
Thank you Scott,
Thank you Olaf

As scott mentioned:
******
SELECT <TABLE>
SET ORDER TO <CODE>
GO TOP
lnCodeFooter = amount3+amount2-amount1

Then in your report forms footer, in the field expression just put in:

lnCodeFooter
******
This will work if I selected records for one codes to display, not more. I have such a report for one selected code and set as you mentioned.
but I have records with 100 different codes that are displayed in the same report one after the other with group header and group footer
and every code have many records "the code is the grouping key"
so,when the cursor is on the first record of the first code it does the expression "calculation of fields value"
then continue to display the rest of records of the same code. At the last record of the same code, fields have different values
but, I want to use the value of the expression that I calculated from the first record before it continue with a new code on a new page.


Best Regards,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

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