Clone element with multiple panels

Stimulsoft Reports.NET discussion
alepage
Posts: 53
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Clone element with multiple panels

Post by alepage »

Hello the Stimulsoft Team,

I'd like to use one clone including a container that match with multiple panels which are situated on another page. With a condition or an event, is it possible to change the container before rendering the report ?

I think an event is the better method, but only the first panel appears on the final report :?

:arrow: There is a sample in attachment, with his XML data source file. I used here a beforeRender envent on the data band.

Thanks in advance.
Arnaud
Attachments
data sample.xml
(49.43 KiB) Downloaded 163 times
report sample.mrt
(304.88 KiB) Downloaded 351 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Clone element with multiple panels

Post by Alex K. »

Hello,

We couldn't run your report. In your report dictionary is empty and all relations are lost.

Thank you.
alepage
Posts: 53
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Re: Clone element with multiple panels

Post by alepage »

Hello,

I don't understand because the xml file contains data on my post.

Here is some screenshots.

On a fist page, I use a clone in a data band in reference to a category named "ARTICLE".
Clones.png
Clones.png (61.65 KiB) Viewed 6001 times
The clone is not affected to a panel a this time.

On another page, that is desabled, I place another band that referenced to the "ARTICLE" category. Then, I place on this band multiples clones whose names could be seen on the first screenshot.
There is the second one that present the second page of my report :
Panels.png
Panels.png (62.9 KiB) Viewed 6001 times
With an "before rendering" event that I use with the databand of the fist page, I'm trying to change the container in function of a value returned by one of our variables.
Here is a sample of those variables present in the report dictionnary :
report_dictionnary.png
report_dictionnary.png (19.7 KiB) Viewed 6001 times
I use that kind of test in the event :

Code: Select all

if(ARTICLE.ARTICLEFRN.VAL181 == "HApplique") Clone1.Container = PanneauHApplique;
if(ARTICLE.ARTICLEFRN.VAL181 == "HAppliqueDecalageSeuil") Clone1.Container = PanneauHAppliqueDecalageSeuil;
When the value is initialized with the first data, the container is correctly affected. With a second value received in the databand, that is different of the first one, the clone is still refered to the same container when rendering. With a third value that is the same as the first one, the clone present correctly to the panel.
rendering.png
rendering.png (75.32 KiB) Viewed 6001 times
I hope my explanations are enough detailed.

Thanks in advance.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Clone element with multiple panels

Post by Alex K. »

Hello,

Your XML file does not contain relations. Please send us XSD file also.

Thank you.
Attachments
Capture.PNG
Capture.PNG (78.04 KiB) Viewed 5992 times
alepage
Posts: 53
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Re: Clone element with multiple panels

Post by alepage »

Hi,

I've seen with our developer, we don't have XSD files.
Those relations are added after loading the XML file in the dictionnary by using those instructions (c# code) :

Code: Select all

   DataColumn parentCol = _reportData.Tables["ARTICLEFRN"].Columns["_ID"];
   DataColumn childCol = _reportData.Tables["ARTICLE"].Columns["_IDCMDFRN"];
   _reportData.Relations.Add(parentCol, childCol);
                        
   DataColumn parentCol = _reportData.Tables["GRPART"].Columns["_ID"];
   DataColumn childCol = _reportData.Tables["ARTICLE"].Columns["_IDGRPART"];
   _reportData.Relations.Add("GRPART_ARTICLE", parentCol, childCol);
The developer told me the XML file I've send to you was finally unfinished.
There is another file in attachment. I hope you could use this one.

Thanks,
Arnaud
Attachments
data sample.xml
(72.71 KiB) Downloaded 349 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Clone element with multiple panels

Post by Alex K. »

Hello,

You can use the following code in the AfterPrint event of the page to save uses data to xml and xsd:

Code: Select all

ARTICLE.DataTable.DataSet.WriteXml(@"d:\data.xml");​
ARTICLE.DataTable.DataSet.WriteXmlSchema(@"d:\data.xsd")​;
Thank you.
alepage
Posts: 53
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Re: Clone element with multiple panels

Post by alepage »

Hello,

Here there are.

Thank you
Attachments
data.xsd
(62.08 KiB) Downloaded 179 times
data.xml
(46.3 KiB) Downloaded 332 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Clone element with multiple panels

Post by Alex K. »

Hello,

Thank you for the test data.
We need some additional time to investigate the issue. We will let you know about te result.

Thank you.
alepage
Posts: 53
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Re: Clone element with multiple panels

Post by alepage »

Thanks too
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Clone element with multiple panels

Post by HighAley »

Hello.

Please, try to add a Sub-report with a Data band and Child bands.
You could disable all unnecessary Child bands using Conditions.
Please, look at the attached image.

Thank you.
Attachments
SubReportImage.mrt
(12.45 KiB) Downloaded 353 times
Post Reply