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

DATAREPORT! ROWS OF DATA AS WELL AS SINGLE LINE DATA. POSSIBLE??? 1

Status
Not open for further replies.

chriscorran

Programmer
Oct 20, 2002
15
GB
Hi,

I have no problem creating a report ie.

2 gloves 5 10
1 hats 50 50
7 shoes 6 42

Select all your data and then it gets listed yeah ! Row after row of info. This is great but what if you have SQL gotten, info to display that only needs to be displayed once as a heading for the other listed info? ie.

job: 123 order: ORD45345

qty descrip cost total
2 gloves 5 10
1 hats 50 50
7 shoes 6 42

When I've tried this I get,

job: 123 order: ORD45345

2 gloves 5 10

job: 123 order: ORD45345

1 hats 50 50

job: 123 order: ORD45345

7 shoes 6 42


Please help if you can. Would be greatly appreciated,

regards,

Stressed Out Chris
 
Hi

You need areport and a sub report.

You base the main report on the 'job' bit in your example and the Subreport on the 'detail'info

You need to consider what the link fields are, from your information, it is either Job and/or Order Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi,

Thanks for your response by the way. Is this somewhere on the right track. Sorry if this is a simple topic for you.

1. Sort out Data Env with paramed stored procedures. 1 for job bit and 1 for detail bit.

2. Insert a group header/footer. (I think/hope thats what you meant by a sub report and main report), giving top section for header/title info (stored proc no1), and the bottom section for the main report (stored proc no2).

Is that about right? Of course I'll try it out but if I'm barkin up the wrong tree it'd be good to know.

Once again, Thanks,

regards,

Not so stressed out Chris




 
Hi

From your description of the report you are trying to produce, you could I suspect do this via Sorting and Grouping, which is what you suggest. In that case you would need an SQL statement which joined the 'header' and 'detail' tables, and this would be the rowsource of your report.

What I was suggesting was a subreport. Ie you make areport based on your first stored procedure (ie the 'header' information). And another report based on your 'detail' information, your second stored procedure.

On the first report you place a subreport control, which contains the second report, and sepcify the link criteria as I indicated in my first post.

The subreport (or subform) allows you to embed a report (or form) within another report (or form). The sub report may itself contain a subreport (I think the maximum nesting is 3 deep, but I am not certain on that).

Hope this helps
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi,

Thanks for your advice.

The thing is though, within my data environment, the stored procedure will get information which in turn will be used by child commands.

As a child command needs to have a relation set up before hand, inorder to link it to its parent, it doesnt work as the parameterized stored procedure has not been called yet with its parameter !!!!!!!! Help !!!!!!!!!

If you have any hints on what can can be done it'd would be greatly appreciated.

ps. Just to clarify things I'm using the data environment and datareport designer.

Many regards,

Chris
 
If anyone else has a problem like this, this is how I got the thing to work.

It all boiled down to making sure that all the data that I collected using the dataenvironement was hierarchically correct for my report.

ie. I needed.

job: 123 order: 12

qty descrip cost total
2 gloves 5 10

Total 10

job: 123 order: 13

qty descrip cost total
1 hats 50 50
7 shoes 6 42

Total 92

Grand Total 102

By using a start off paramaterized command(sql statement) to get the higher level info. ie job no and order no, then using a child command based on the previous statement, to get the meat of the report.

The paramaterized command(sql statement) is cool coz you can make dynamic reports based on what info you pass to the command object.

Search for "data environment programming guidelines" on the microsoft site, for a really straight forward example of how to pass arguments to your parametized command(sql statement), before you view your report.

On the actual report side of things the screens split into sections (hierarchically), so for my example the job details would go in the report header. The headers for the following report information would go here too, so they dont get repeated for every record you have.

The main details of the report, ie your records, simply go into the details section.

All your fields are linked to the data environment you set up previously. As long as you set it up correctly with regards to which information is a main command object(sql) and which information is in a child command, the report will let you select your information in the format that you set up.

The sub totals and grand total where calculated using the function command built into the the data report.

The sub totals went into the report footer, so after all the records for the details section where displayed, the totals could be placed at the end.

so it kind of went like.

header
details
summary
final summary

I have to say though the datareport that comes with VB is a pain in the arse. Dont know if this would make it any clearer for someone else out there but there it is.

regards,

Chris

ps. Cheers kenReay for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top