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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Printing Problem 1

Status
Not open for further replies.

GKBray

IS-IT--Management
Jan 14, 2003
51
0
0
GB
Hi all,

I am fairly new to Foxpro, and am having a problem with printing a report.

I am using the command;
"Report Form C:\myreport.frx FOR RECNO()=Myvar to PRINTER Noconsole"

This Prints the Header record fine, but only the first record in the detail band, which is a related one to many child table.

Please help.

Many thanks

Graham
 
Hi Graham,

Report Form C:\myreport.frx FOR RECNO()=Myvar to PRINTER Noconsole


Here.. myVar relates to what.. The parent recno() or the child record number.

Make sure that you have the Parent table as your default alias..

Select myParentTable
Report Form C:\myreport.frx FOR RECNO()=MyParentRecNo ;
TO PRINTER Noconsole
:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
does the header information come from the parent or the child table? the table that prints the detail information should be the selected table, and the relation should be set from this table into the table which will print the header information.
eg: customers.dbf and transactions.dbf
select customers
set order to custnumb
myVar = custnumb
select transactions
set relation to custnumb into customers
report format report.frx for transactions.custnumb = myVar

if you use recno() in your for clause for report format, you will only ever get one detail band because there is only ever one recno() in any file that matches the record number you want to print.
 
I try ameding my code, many thanks for your reply.
 
Many Many Thanks RLG07734, I have left out the relation command, but followed your theme.

The key here as far as I can make out is to have the child table selected at the time you issue the Report Form command.

Regards
Graham
 
One thing to keep in mind with vfp report forms ...

The file that is active when you execute the report form will determine how many times the report prints the detail band. It makes no difference what is in the detail band. It will get printed once for each record in the active file.

Now, having said that ... You can get fancy and try to change the active file during the printing of the report but that can be very tricky and is not the way report forms expect to be used.

So, if you are printing invoices ... You have to have the DETAIL file active and in the correct order when you start the report. You will wish to relate the INVOICE NUMBER to the invoice header file so each time the INVOICE NUMBER changes you can print out the header information. You would use a GROUP band for that ... etc ....

Good Luck
Don
dond@csrinc.com

 
Many thanks for all your help.

I am really starting to enjoy Foxpro, as I learn more it gets less frustrating and more fund.

Regards

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top