Re: Hide duplicate Component (not only textfield)
Posted: Thu Mar 26, 2015 2:07 pm
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!
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
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);
}
}
regards