Sub Reports in a Data report in VB6 - URGENT

Hi All,

I am in the middle of converting my system from Access2000 to VB and SQL.  One of my access reports has a sub report how do i do a subreport in a VB data report.

Kind regards,

Munzi
munzi791Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

p_sieCommented:
What you mean by subreport?

Vb datareport has limited options.
0
munzi791Author Commented:
ummm for example i have a table showing all the vehicle details, ie reg, color, model ect and i have another table showing when the car was in use ie 12/11/04, 13/11/04 and the table are linked by the reg number.

So i need a report in a format similar to this

Vehicle details Reg:
  Color : Red
  Type : Saloon
  x: x
  y: y
  more : depending on table

    Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
Next Vehicle ans so on

I hope you can understand this
0
p_sieCommented:
That is possible

Right click in the datareport and click on insert group header/footer
Then put the items you want in the 'header' in the header band and the sub-items (the dates in your case) in the detail-band.

Also check : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconUsingMicrosoftDataReportDesigner.asp 
for more info on the datareports
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

munzi791Author Commented:
I have already tried this but this gives me the information in the following format

Vehicle details Reg:
  Color : Red
          Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
  Type : Saloon
          Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
  x: x
          Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
  y: y
         Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
  more : depending on table
    Dates in use
      Date: 12/11/04   Reason: Rent
      Date: 11/11/04   Reason : Skip
      more: depending on table info
Next Vehicle ans so on

So as you can see it is repeating the dates for each vehicle property.

Rgds
0
p_sieCommented:
You have to put all the vehicles properties in ONE header band!

How is the data provided to the datareport i.e. what's the structure?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
munzi791Author Commented:
I am using the following properties;

DataSource = DataEnvironment1
Datamember = Command1

If i do what you have suggested i get an error message 'Report sections do not matchdata cource'

Rgds
0
p_sieCommented:
How is the command build up (what is the SQL-string)?
0
munzi791Author Commented:
SELECT [RentDates].*, i_Definitions.Property, i_Definitions.Desc
FROM [RendDates] LEFT JOIN i_Definitions ON [RentDates].[Reg] = i_Definitions.Reg;
0
p_sieCommented:
Add a 'Group By' clause with the items you want in the header-band!

SELECT [RentDates].*, i_Definitions.Property, i_Definitions.Desc
FROM [RendDates] LEFT JOIN i_Definitions ON [RentDates].[Reg] = i_Definitions.Reg
GROUP BY  .....
0
munzi791Author Commented:
i have already tried this but this does not work for the following reason,

I need 2 details section as the properties comes from one table and the dates from another table, the prperties are unique to each vehile ie vehicle 1 can have colour, type, model and vehicle 2 can have type, sige, weight, door etc after this we need to add the dates when the vehicle was in use.  If i group them the way you have suggested i will get these results;

Vehicle 1
 property 1
   dates
   dates
   dates
property 2
   dates ' repeated again
   dates ' repeated again
   dates ' repeated again
property 3
   dates ' repeated again
   dates ' repeated again
   dates ' repeated again
0
munzi79Commented:
Use VB.Net as it is alot easier and includes Crystal reports.
0
p_sieCommented:
Munzi, I posted in the community support that you answered the question yourself, cause that is not the way to do it!!!

See:
http://www.experts-exchange.com/Community_Support/Q_21215786.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.