Problem with relations between 2 databands

Stimulsoft Reports.NET discussion
Post Reply
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with relations between 2 databands

Post by Jennypi »

Hi everyone,

I try to do a report containing 2 databands:
Databand1 will show "samples" with its information, and databand2 is supposed to show additional information about each sample. I can not manage to have only one query (too complicated for me) so that's why I have to deal with 2 databands.
With databand1 only, the report works very well. But at soon as I add databand2, nothing show up on the report, it's blank (with only the header). I did set a relation ("myrelation") between those 2 databands, I've set Data Relation of databand2 to "myrelation" andset Master Component to "DataBand1". However it is still showing nothing!

Where am I wrong?

Thanks!
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Problem with relations between 2 databands

Post by Brendan »


How are you registering the Data for your report. Is it coming from within the report itself via an SQL Datasource or are you registering DataTables / Dataset?

There's also some Master-Detail examples in the Demo application which may help.

One thing to try first is to set the property 'Printer if Detail Empty' on the Masterband (databand1) to True. This means it should print all header details if it doesn't have any child details. If the headers are printing and not the children (additional information) then maybe examine the relation you created from the 2nd Datasource used for databand2 to make sure it is defined correctly.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with relations between 2 databands

Post by Jennypi »

Data is coming via an SQL datasource.

Actually, the header I'm talking about is the header of the report, not the master databand.
When I put only databand1, its data shows up. When I add databand2, nothing shows up. Meaning that I see nothing on my report, only its title/header.

I've set the Print if detail empty property to True and master data is printed. I examined again my relation but I'm sure that I've set it properly, I really don't see where my mistake is...

Thanks for your help.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Problem with relations between 2 databands

Post by Jan »

Hello Jennypi,

Please send your report to support@stimulsoft.com. In EMail add reference to this topic. We will examine your report and will give you recommendations how to fix it.

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

Problem with relations between 2 databands

Post by Edward »

Hello Jennifer,

Please right-click the Datasource in the dictionary and select View. Does the request return any data?

Also please check that appropriate columns in the datasources which you need to join with relations have correct values.

I have no idea what could be wrong with your report...

Thank you.

Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Problem with relations between 2 databands

Post by Jennypi »

I'm back on this subject because although Edward tried to help me, I still have my problem.

Now I'm not working on the same report anymore, but the problem is the same: detail databand shows nothing although the query is working perfetly when alone. The relation between the 2 databands is set properly.
Please have a look at the screen captures below:
- the results of both queries and the relation on the "location id" field (you can see that the content of this field is indeed exactly the same)
Image
- the properties of my detail databand (is it normal that relation property is back to 'not assigned' everytime I double click on the databand?)
Image
- and my form with OK button event editor
Image

And finally my report: http://demo.ovh.com/fr/14175f925aef3349 ... afb436865/

Please help! It's really driving me crazy!

Thanks,
Jennifer.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Problem with relations between 2 databands

Post by Jan »

Hello Jennypi,

I'm not sure on 100%, try following: add to button click event handlers, after data.Connect() method following line of code:

Code: Select all

this.Dictionary.RegRelations();
Let me know about results.

Thank you.
Post Reply