Master-Detail problem

Stimulsoft Reports.PHP discussion
Post Reply
carlose
Posts: 3
Joined: Fri May 18, 2012 2:16 pm

Master-Detail problem

Post by carlose »

Hi, I downloaded your trial. I'm having this problem: I am making a master detail report with mysql as datasource.
I have the 2 selects, one for master and one for detail as two datasrouces, and I create the relation too.
I have a databand with the first datasource as data source and a second databand with data source set to the second datasource, Data relation set to my created relation and finally the master component property set to the first databand.
The problem I have is that in the detail databand the report shows the records associated to de corresponding master record AND after that it shows all the other detail records as there were no filter from the relation.
All samples with master detail reports have a xml data source.
Is this a problem with mysql or I am doing something wrong? Could you send me a sample?
Thanks in advance.
Carlos
carlose
Posts: 3
Joined: Fri May 18, 2012 2:16 pm

Master-Detail problem

Post by carlose »

I found the problem. In my tables I have a composite PK with 2 fields and it seems that, even I can define the 2 fields in the relation, when the report is rendered the relation with 2 fileds doesn't work ok.
I solved the problem creating a new field in the SELECT statement with CONCAT(pkField1, '_', pkField2) as id and creating the relation with that new field.
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Master-Detail problem

Post by Andrew »

Hello,

Great! Thank you for sharing your experience.

Thank you.
Post Reply