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!

Help with SHAPE command (ADO), please :)

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
I'm looking for some help with the ado SHAPE command used in conjunction with data reports.

I want to group data by "Shift". The data includes the following fields: "Sorter", "Minutes", "Time".

I have the datareport set up in the following manner:

ReportHeader
PageHeader
GroupHeader
Shift
Details
Sorter
Minutes
Time
GroupFooter
PageFooter
ReportFooter

I don't know what to label the DataField value of the text boxes in the group and detail section. Also, I don't know if the following command returns the results I need:

SHAPE {SELECT Shift FROM tblMinutes} APPEND ({SELECT * FROM tblMinutes} AS Details RELATE 'Shift' TO 'Shift') AS Details

This SHAPE thing has got me totally confused. I tried reading through the MS Knowledgebase pages, but they aren't exactly clarifying, if you know what I mean.

Can anyone point me in the right direction? Thanks a bunch!
Take Care,
Mike
 
Wow, i amazed myself today: I solved my own problem... hehe. Here's what i did:

ReportHeader
PageHeader
GroupHeader
Shift
Details
Sorter
Minutes
Time
GroupFooter
PageFooter
ReportFooter

That was the Layout i needed, so I reformulated the SHAPE command as scorpio66 suggested in another thread in the following manner:

SHAPE {SELECT * FROM tblMinutes} AS Data COMPUTE Data BY 'Shift'

Then I went into my datareport and set the Datamember properties of all fields in the details section to 'Data', so that they would reference that recordset declared in the shape command. I set the datafield properties to their respective names in the database.
Then I set the datafield property of the field in the GroupHeader to 'Shift', so that it would correspond to the value in the BY clause of the shape statement.

It works wonderfully! Thanks scorpio66 ;)

Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top