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

DataReport Question

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I am running a sp from my sql server attaching the sp to a datareport that prints out. My question is, I would like to add a line in the detail of the data report to seperate document numbers on the report. in Access there is grouping on the report. is this possible with VB?

Thanks in Advance

 
i am not sure about DataReports, since i use ActiveReports or Crystal, but if you want to make the data group like Access you should be able to do a GROUP BY in your SQL and send that data pre-grouped to the Report.
 
Yes..thats what I am doing. but I need to put a line to seperate each group on the report..

e.g.

Doc#
1234
1234
1234
-----------------------
5678
5678
-----------------------

etc...

 
I think you will need to pass a hierarchical recordset to be the data source for your data report. Something like this:

Code:
SQLCmd = "SHAPE {SELECT DISTINCT Doc FROM Table Order By Doc} As Parent " & _
    "APPEND ({SELECT * FROM Table Order By Doc} As Data " & _
    "RELATE Doc TO Doc)"
Set DataReportRS = DB_Connection.Execute (SQLCmd, , adCmdText)
Set DataReport.DataSource = DataReportRS
[\code]

Then you would insert a group into the data report to print your line on Doc breaks.
 
Unfortunately it is not as easy as just inserting a group in your report... it is a lot more complex than that. Data Reports in VB are very cumbersome to work with. If you have another option for a reporting tool, I would recommend using that instead.

What you will need to do in your data environment is create a command. Then for your different groupings, you would insert child commands. You will need to relate the data in the child command back to your parent command. From what I understand of what you want you will need a parent and a child command.

See thread222-369716 for a more detailed explanation of how it works. Like I said, it is complex... at least more complex than anything else I've ever worked with.
 
screw it...thanks for all your input guys. I have crystal as well, I'll try it with that. it's not that important, i think the user can live without it.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top