Using the subreport component inside a databand

Stimulsoft Reports.NET discussion
Post Reply
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Using the subreport component inside a databand

Post by jing »

In the subreport I have successfully got it to print out a server's name and description and other information such as boot up time etc. The server to print out is decided by a parameter @serverID, which is set by a lookup box.

In the master report, I have got a databand setup using datasource "Server", which has a list of serverIDs.

My question is, how do I add this subreport inside a databand in the master report, so that the subreport will render depending on the serverID passed in through the "Server" datasource ? More specifically, how do I "Pass serverID from a databand to a subreport"?

Thanks a lot

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

Using the subreport component inside a databand

Post by Edward »

You can use a master-detail model for the creation such reports. There exists 2 ways to achieve the goal:
1. Establish a connection between Master and Detail via a Relation.
Please see flash tutorials:
http://www.stimulsoft.com/livedemos/Rep ... eport.html
http://www.stimulsoft.com/livedemos/Rep ... ort_2.html
an example from the Demo application: Master-Detail report in Master-Detail Reports group.

2. Also in the SQL-based reports may be used a queries with parameters:
an example from the Demo application: Master-Detail with parameters report in SQL group.
flash tutorial for working with parameters:
http://www.stimulsoft.com/livedemos/Rep ... eters.html

Thank you.
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Using the subreport component inside a databand

Post by jing »

Thanks for your reply.

So does this mean the subreport component has no use in the report designer?

By using the master-detail model, it will mean that I need to redesign my "subreport" inside the master datasource - is there an easier way around?

Thanks
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Using the subreport component inside a databand

Post by Edward »

Yes, the easier way exists. Also subreport component may be used in the Master-Detail type reports.
You have to place a SubReport1 (it will be Detail) on the DataBand1 (it will be Master). For the Detail DataBand2 in the SubReport1 you have to set DataBand2.MasterComponent=DataBand1 and also necessary to provide a Relation between DataSources which are used by DataBand1 and DataBand2.

Please see the example Master-Detail in the SubReports Group of the Demo example application.

Thank you.
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Using the subreport component inside a databand

Post by jing »

Hi,
Thanks for your reply.
I am having problem setting "DataBand2.MasterComponent = DataBand1", where can I set this? In my subreport DataBand2's property, I can not see DataBand1 - it's not visible. The only option I have is "Not Assigned".

Also, where do I find the example you are talking about?

thanks


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

Using the subreport component inside a databand

Post by Edward »

jing wrote:Hi,
Thanks for your reply.
I am having problem setting "DataBand2.MasterComponent = DataBand1", where can I set this?
Please double click on the DataBand2 (In SubReport) and then will appear a window for setting a MasterComponent (for Databand1 from the page1). On the page "Master Component" you can set DataBand1 as the Master Component.
jing wrote:In my subreport DataBand2's property, I can not see DataBand1 - it's not visible. The only option I have is "Not Assigned".
Please take the latest prerelease build of StimulReport.Net. You can get it here: http://www.stimulsoft.com/DownloadsSR.aspx
jing wrote:Also, where do I find the example you are talking about?
An example you can take here:
http://www.stimulsoft.com/forum/sample5432.zip

Thank you.
Post Reply