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

Students Click Here

Report based on a View Problem

Report based on a View Problem

Report based on a View Problem

(OP)
I have created a report based on a view. When I preview this report in design mode everything is OK. But when I preview the report in the running program and I want to see the next page, the report can not find variables. When I use the full fieldnames including the alias name instead of only the fieldname this is OK, but when I go to the next page I only see all the same records.

RE: Report based on a View Problem

This does not sound like a "view problem", but a variable scoping problem.

Try isolating the problem by taking the view out of the picture:

1) Dump the data out to a .DBF file.
   USE MyView
   REQUERY()
   COPY TO frxTable
   USE IN MyView
   USE frxTable EXCLUSIVE

2) Call your report from a simple program.  At first, declare all variable PUBLIC to make sure it works as you think.

   PUBLIC gdStart, gdEnd
   USE frxTable

   *- Make sure "development" environment still works.
   MODIFY REPORT MyFrx

   *- After saving changes to the report, run it.  It should work just like in the previous MODIFY REPORT above.
   REPORT FORM MyFrx PREVIEW

   *- See which memvars (if any) remain after the report.  If you use report variables, they can be released by the REPORT FORM command, and therefore be GONE at this point.
   LIST MEMORY LIKE *

You only have to used aliased field names for cursor fields in other work areas.  The field name alone if fine for the current alias.

Hope this helps.

RE: Report based on a View Problem

It sounds like the table from which the report pulls data is not the currently selected table when the report is run.  The clues I'm going by are:  adding alias makes data appear; but its the same data over and over.

Robert Bradley

FoxDev - Visual FoxPro Development

RE: Report based on a View Problem

watch your variables and remember if they are form properties they go out of scope.  almost sounds like you're defining memvars from the command window in design time which makes your vars public.  Then in runtime they are not and are expected or needed to be the way you have your code.  Also if you preface the variables in your view definition with a ? you can create a parametized view that prompts the user for the value if it is previously undefined.  Watch the scope of your mevars and check the DE of the report.  Generally I never use the DE of a report or aliases.

John Durbin


ICQ VFP ActiveList #73897253

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! Already a Member? Login

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