Home » Archives » April 2006 » Multiple Detail Band in Visual FoxPro 9

[ Previous entry: The Darkness Volume II ]
[ Next entry: Multiple Detail Band (GIF Format) ]
04/06/2006:

Multiple Detail Band in Visual FoxPro 9


After countless trials and errors, with each error pounding one of my faithful neurons, reading (and re-reading and re-reading), roundtrips to the Program Files\VFP9\Samples directory and pathetic attempts to have a crash course on 'Absorbing the Mozart Effect 101'... I finally figured out how to make VFP9's multiple detail band feature work on one of my reports.

(And no, Mozart wasn't helpful this time.)

More than 77 neurons are off to meet their maker. I stopped counting though an hour and a half ago, so there's probably more. (And we're not even counting the injured and now-limb-less ones.)

Yes I know... I'm quite late with this. Most VFP9 coders are now using the multiple detail band to extract data from different databases located in parallel universes while I have been using the dump N table records to one 'cursor/table holder' with generic field names where I can extract data for reporting...

... or firing up CrystalReports.

Anyway at 1:37AM, I'm scribbling this down just in case an alien decides to teleport its presence here in this room, do some wholesome (I hope) experiments and decides to mind-wipe me afterwards, which might possibly corrupt this multiple-detail-band-eureka moments I have.

Also this could probably help a coder out there who decides to google things after being mind-wiped by an alien.

Just a basic overview... I'll call these step by step 'hints' not a 'guide'. (A User Guide expert would scream bloody hell when he sees this. (But trust me a programmer will understand. (Especially those mind-wiped by aliens.)))

Given:
Parent.dbf / Child01.dbf / Child02.dbf
Right click = Right click in the Report Designer.

1.
 File. New. New report. (No wizards.)  
2.
 Data Environment. Add the three (or more) tables. 
3.
 Set the relationships. (P » C01 and P » C02.) 
4.
 Right click. Select Data Grouping.  
5.
 Data Grouping tab. Group Nesting Order box. Add. And add field from your parent table (Your primary key... for example: PARENT.CODENO)  
6.
 Right click. Optional Bands. In the Detail Bands box, Add another Detail Band.  
7.
 Now you have two bands. One for you, one for the alien. 
8.
 Double click on the Detail 1 separator. The Detail Band Properties window pops out. (Or if you like the longer process... Report... Edit Bands... select Detail 1.)  
9.
 Check Associated header and footer bands. (Trust me you need this. Aliens are allergic to this.)  
10.
 Repeat steps 8 - 9 for Detail 2.  
11.
 Data Environment. Drag the fields to their appropriate bands. Parent fields on the Group Header. C01 fields in the Detail 1 band and C02 fields on the Detail 2. And aliens in the footer part.  
12.
 BTW... you should have saved your report already and instinctively press CTRL+S every now and then in case the aliens...  
13.
 Now double click the Detail 1 'bar' (separator) again.  
14.
 Detail Band Properties. In the Target alias expression enter 'child01' or the name of your child database. (NOTE: Be sure to include the '') 
15.
 Do the same with the other Detail bands. The Detail 1 band separator should now look like 'Detail 1: Child01'. 
16.
 Add appropiate headers, lines and all. Align things.  
17.
 Beautify your report. Make it look professional. Nevermind if your clients are using a stone-age dot matrix printer.  


Hope this helps.

Now I'm off to re-inspect the protective shields of this room.


Disclaimers are for castrated EARTHLINGS.
Powered: GREYMatter | GM-RSS

 

 
 
 
 

 

foxpro.main
foxpro.archives
richardbase.home

articles
downloads
snippets
utilities
knowledgebase.links
website.links

outpost.forum
the.site
the.catalyst
pixelcatalyst.lair

rss.feeds

April 2006
SMTWTFS
      1
2345678
9101112131415
16171819202122
23242526272829
30      
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004





GEEK count:
visitors since the aliens rebooted the counter last 02.23.2006 (was around 33,000++ before the alien intrusion | SINCE: 02.26.2004)