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

Master detail report using cursors?

Status
Not open for further replies.

JGAS67

Programmer
Oct 21, 2007
5
SI
Hi,

i need to do a MD report from 4 tables, but since they can be in different locations (user can pick a physical location of data) i cannot use data enviroment with tables, so i guess, i should create cursors. How can i create md report (visually, without too much coding :)) from there on. Can i use indexes with cursors and make relations from master to detail cursors? Can i use cursor adapter in report? Should i CAREFULLY READ VFP help?

Thanks for suggestions.

Andrej
 
Andrej,

You've got two choices:

You can create a single cursor, in which each record contains the detail fields plus the corresponding master fields. Think of this as a denormalised cursor. Make this the driving cursor of the report. Within the report, create a group to diplay the master fields.

Or: Create two cursors, one master and one detail. Use SET RELATION and SET SKIP to set up a one-to-many relationsip between them. Make the master cursor the driving cursor for the report. In the report, place the fields from the detail cursor in the detail band, and those from the master cursor in the group band.

Can i use cursor adapter in report?

You can, but it won't solve this specific problem.

Should i CAREFULLY READ VFP help?

Most definitely. Pay special attention to the topics on SET RELATION and SET HELP.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top