Hide duplicate Component (not only textfield)

Stimulsoft Reports.NET discussion
markbosshard
Posts: 16
Joined: Thu Mar 12, 2015 3:28 pm

Re: Hide duplicate Component (not only textfield)

Post 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
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Re: Hide duplicate Component (not only textfield)

Post by StixStax »

Hey Mark,

would you mind creating a sample file?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Hide duplicate Component (not only textfield)

Post by Alex K. »

Hello, Mark.

Thank you for your solution.
Post Reply