Page 2 of 2

Re: Hide duplicate Component (not only textfield)

Posted: Thu Mar 26, 2015 2:07 pm
by markbosshard
I have found the solution, in the end it is very easy to implement:

I have my document set to DoublePass, so therefore I only wanted it to happen in the second pass.
As a preparation you have to go to "Dictionary" and set up a Variable, in my case I am filtering dataitems with the name "parameter", so I set up the variable Param_ToBe_Printed: set it up as a list of strings.

Then use the following code in the BEFORE PRINT of the data item that you want to filter for duplicate. Note: If you have the SAME data item somewhere else, setting the same code somewhere else easily allows you to filter duplicates in the whole document!

Code: Select all

if(IsSecondPass){
	if(Param_ToBe_Printed.Contains(Related_Requirements_2.Code)){
		((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = false;
	} else {
		Param_ToBe_Printed.Add(Related_Requirements_2.Code);
	}
}
don't hesitate to contact me if you have any questions, put in "mark.bosshard" in front of "@gmail.com" to find out my mailaddress (spamfilter).

regards

Re: Hide duplicate Component (not only textfield)

Posted: Fri Oct 02, 2015 12:16 pm
by StixStax
Hey Mark,

would you mind creating a sample file?

Re: Hide duplicate Component (not only textfield)

Posted: Mon Oct 05, 2015 5:45 am
by Alex K.
Hello, Mark.

Thank you for your solution.