subreport

Stimulsoft Reports.NET discussion
Post Reply
kubru
Posts: 8
Joined: Fri Aug 25, 2006 6:59 am
Location: Belgium

subreport

Post by kubru »

Hello

I'm trying to make a multicolumn list, comparable to your 'labels' example.
How would I implement a subreport with eg. the top 5 products ordered per ID on the same label?

As for now I can't find a way to link a subreport to the ID-field on the label.

All hints are greatly appreciated!
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

subreport

Post by Vital »

So you need create master-detail report with columns. Please see sample report Master-DetailWithColumns

You can open this report from Demo and run it.

Thanks.
kubru
Posts: 8
Joined: Fri Aug 25, 2006 6:59 am
Location: Belgium

subreport

Post by kubru »

Thanks for your answer, but I'm afraid that's not exactly what I need.
If I compare it to your example I'd like a report where the beverages are also in columns and not spread as a header.

So something like:
[left]lemonades beers wines
lemonade1 beer1 wine1
lemonade2 beer2 wine2
lemonade3
yoghurts sandwiches pastas
yoghurt1 sandwich1 pasta1
yoghurt2 sandwich2 pasta2
yoghurt3
yoghurt4[/left]


I hope you can tell me how to do this?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

subreport

Post by Edward »

kubru wrote:Thanks for your answer, but I'm afraid that's not exactly what I need.
If I compare it to your example I'd like a report where the beverages are also in columns and not spread as a header.

So something like:
[left]lemonades beers wines
lemonade1 beer1 wine1
lemonade2 beer2 wine2
lemonade3
yoghurts sandwiches pastas
yoghurt1 sandwich1 pasta1
yoghurt2 sandwich2 pasta2
yoghurt3
yoghurt4[/left]


I hope you can tell me how to do this?
Please see report example in attachment.
Thanks.
Attachments
SubReports.zip
(6.28 KiB) Downloaded 346 times
kubru
Posts: 8
Joined: Fri Aug 25, 2006 6:59 am
Location: Belgium

subreport

Post by kubru »

Thanks for your example. It does exactly what I need.
But I'm still having problems to get it working in my case.

I'm trying to create a catalog of all our existing models and the fabrics in which they will be available. I us a SQL database and I created two datasources: tblModels and tblFabrics.

SQL for DataSource 1:

SELECT * from tblModels

SQL for DataSource 2:

SELECT tblFabrics.quality, tblFabrics.descr FROM tblFabrics WHERE tblFabrics.FabricId IN (SELECT FabricId FROM tblModels WHERE modelnr = @modelnr)

I also made a relation which links tblModels with tblFabrics on FabricId.
I suspect the problem lies in the SQL, but I can't compare it as in your example the SQL is not visible.

I'm also having trouble with the parameter in my second SQL. When I click on 'retrieve columns' I keep getting a warning 'Scalar variable @modelnr not defined'. However I did create the parameter as described?

Your help is very much appreciated!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

subreport

Post by Edward »

kubru wrote:Thanks for your example. It does exactly what I need.
But I'm still having problems to get it working in my case.

I'm trying to create a catalog of all our existing models and the fabrics in which they will be available. I us a SQL database and I created two datasources: tblModels and tblFabrics.

SQL for DataSource 1:

SELECT * from tblModels

SQL for DataSource 2:

SELECT tblFabrics.quality, tblFabrics.descr FROM tblFabrics WHERE tblFabrics.FabricId IN (SELECT FabricId FROM tblModels WHERE modelnr = @modelnr)

I also made a relation which links tblModels with tblFabrics on FabricId.
It is not necessary to build Relation for the Master-Detail reports with SQL queries wich contains parameters. Please set ResetDataSource property of detail DataBand to True.
kubru wrote:I suspect the problem lies in the SQL, but I can't compare it as in your example the SQL is not visible.

I'm also having trouble with the parameter in my second SQL. When I click on 'retrieve columns' I keep getting a warning 'Scalar variable @modelnr not defined'. However I did create the parameter as described?

Your help is very much appreciated!
Please delete lines

Code: Select all

WHERE modelnr = @modelnr
from your SQL query. Then click on 'retrieve columns' button and after retreiving columns add

Code: Select all

WHERE modelnr = @modelnr
to your SQL text.
Also please see Demo application: SQL Master-Detail with Parameters example.
Thank you.
kubru
Posts: 8
Joined: Fri Aug 25, 2006 6:59 am
Location: Belgium

subreport

Post by kubru »

That works fine.

Many thanks!!!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

subreport

Post by Edward »

kubru wrote:That works fine.

Many thanks!!!
Please contact us any time you need help.
Thanks.
Post Reply