Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Problems

Status
Not open for further replies.

anyhandle

Programmer
Dec 1, 2000
57
US
I have a report which uses tables already open prior to the report. This is necessary because the report prints in a while loop for other reasons which is not the problem. The report is built on two tables which are related. Most of the fields come from the child table, but the determination of what records will print are based on the parent table. I allow users to preview this report prior to printing. The preview is fine; however, the printed version bases what records will print on the child table even though the command remains the same. The report call is as follows:

report form myreport while parent.field#0

What would cause this?
 
You didn't mention the settings or status of the data environment in the report itself? autoopentables etc.
 
I'd need a lot more info to really solve this problem but my hunch is this: you're running the REPORT command multiple times (once for preview, once for printing) without resetting the record pointer of the controlling (selected) table.

Jim
 
Thanks for your response.
In response to your replies: I don't open tables within the report, I open them prior to running the report because of checks on the table, etc. The relation is also created prior to running the report. Yes, I'm running the report twice, once for preview and once for printing and I do reset the pointer. It is pointing at the first record, because what it actually prints is the first record, but it prints only one record, which is causing me to believe that when the report checks to see if it should continue printing,

report form myReport while parent.field#0

it views the child file to make the while parent.field#0 comparison rather than the parent file. I'm assuming this because there is no reason why it should print one record then stop. The remainder parent.fields are > 0.
 
I'm assuming that you have a relation set from the "child" into the "parent" as in:

select child
set relation to fieldx into parent

If this is true, and if the child table is the one SELECTed when running the report then yes, it would and should look only at the parent record(s) associated with the current child.

Jim
 
Let me add that if you DON'T have a relation set from the child into the parent, then if the child is the SELECTed table, the record pointer in the parent will remain stationary.

Jim
 
I still wonder if you checked the properties in the data environment. When creating the report you may have added a file for the creation of the report and when you run the report it opens the table. Even though you don't intend for the table to open again in another work area.
This has got me before because I forgot to set the data environment autoopentables to .f. and the autoclosetables to .f.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top