Problem with User Datasource and Master Detail Report

Stimulsoft Reports.NET discussion
Post Reply
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Problem with User Datasource and Master Detail Report

Post by TGoertler »

Hello Stimulsoft Team,

I recently bought your Reports.NET component as it contains everything I need to create reports.

Currently I try to get a master/detail report with UserData done. The videos about creating
master/detail record gave me the first clue about how it works. But now I've a problem with
the user data source. I cannot get it to work, setting the right detail data.

I attached my demo project to this post, so maybe you may help me with this one as I need to
create quite some master/detail reports as soon as I know how to create the user data section right.

I use VB.NET 2008 on a Windows XP pc. The version of Reports.NET is: Stimulsoft Reports.Net 2010.1 R2005

Thank you in advance.

Best Regards,
Thomas
Attachments
566.ReportDemo.zip
(51.99 KiB) Downloaded 208 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with User Datasource and Master Detail Report

Post by Alex K. »

Hello,

Thank you for the post. We will check your project and let you know about the result.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with User Datasource and Master Detail Report

Post by Alex K. »

Hello,

You only need in StiReport1 set Data Relation properties to "Beziehung" and MasterComponent properties to "DataUserData" on DataUserDataDetails component.

Thank you.
Attachments
568.ReportDemo.zip
(87.79 KiB) Downloaded 219 times
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Problem with User Datasource and Master Detail Report

Post by TGoertler »

Hello Aleksey,

thank you very much for this. It seems to work, I don't get an error any more but
now I see one "category" (master) and one "detaildata" (detail). The question is
now, how dow I get all 10 detaildata there?

I hope you can help me with this one too.

Thank you in advance.

Best Regards,
Thomas
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with User Datasource and Master Detail Report

Post by Alex K. »

Hello,

You're doing the right thing.
Do you in completing the data obtained that a single master record has only one detail record.
You can add to the table UserDataDetails column kat_id and remake relation Beziehung (UserData.kat_id, UserDataDetails.kat_id)

Thank you.
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Problem with User Datasource and Master Detail Report

Post by TGoertler »

Hello Aleksey,

thank you for your answer.

I changed the relation "Beziehung" accordingly to your information.
But that didn't change the output at all.

What I get in the report is:
master - Kategorie (number)
detail - (number) System.Int32
master - Kategorie (number)
detail - (number) System.Int32


But what I try to get is:
master - Kategorie (number)
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
master - Kategorie (number)
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data

So I think I have a problem understanding how to get the right data to the "_GetData" Sub.
The data for the master part is no problem at all as the StiUserData1.Count is the dimension
of the master array. But when it comes to the detail data then the control doesn't know how
many lines should be fetched, so it fetches only one line at all.

My Data Structure looks like that:

Structure Demo
Dim demo_Name As String <- Name of master category
Dim demo_Daten() As String <- Detail Data
End Structure

So I think I don't understand how to give the report the detail data array.

Do you have any advice for me here?

Thank you in advance.

Best Regards,
Thomas
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Problem with User Datasource and Master Detail Report

Post by TGoertler »

Hello Aleksey,

thank you for your answer.

I changed the relation "Beziehung" accordingly to your information.
But that didn't change the output at all.

What I get in the report is:
master - Kategorie (number)
detail - (number) System.Int32
master - Kategorie (number)
detail - (number) System.Int32


But what I try to get is:
master - Kategorie (number)
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
master - Kategorie (number)
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data
detail - (number) data

So I think I have a problem understanding how to get the right data to the "_GetData" Sub.
The data for the master part is no problem at all as the StiUserData1.Count is the dimension
of the master array. But when it comes to the detail data then the control doesn't know how
many lines should be fetched, so it fetches only one line at all.

My Data Structure looks like that:

Structure Demo
Dim demo_Name As String <- Name of master category
Dim demo_Daten() As String <- Detail Data
End Structure

So I think I don't understand how to give the report the detail data array.

Do you have any advice for me here?

Thank you in advance.

Best Regards,
Thomas
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with User Datasource and Master Detail Report

Post by Alex K. »

Hello,

In your current structure, you will not be able to use the master-detail report.
For master-detail report, you must use two datasourse.

You can split Demo_Daten:
Master:
kat_id, data
Detail:
kat_id, det_id, data

Thank you.
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Problem with User Datasource and Master Detail Report

Post by TGoertler »

Dear Aleksey,

I tried now several solutions to get more then one detail info to the report.

Now I changed the demo to make it even more easy to understand but I don't understand how the report gets the user data.
I cannot get all data in the right order. Would it be possible to get a demo that works?

In the new demo I added two UserData controls to split the data but it's not possible to set how many details belong to one master record.

Currently I'm quite clueless as I don't know what I should do to get it to work. This form of data is essential in my current project so
it would be really nice to see how it's done right.

Thank you in advance,
Thomas
Attachments
578.ReportDemo2.zip
(82.02 KiB) Downloaded 207 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with User Datasource and Master Detail Report

Post by Alex K. »

Hello,

Please see a modified your project in attachment.
I hope this is what you wanted.

Thank you.
Attachments
579.ReportDemo2_modified.zip
(84.27 KiB) Downloaded 232 times
Post Reply