Hide duplicate Component (not only textfield)
Posted: Thu Mar 12, 2015 4:04 pm
Hi
I have a component, that is being printed many times with the current data. Now within my Data source "related_requirements_2" I have duplicate item, where all attributes are exactly the same. Nevertheless attributes CAN sometimes be the same (like a true or false flag and obviously we have more than 2 data items). The important criterion is that "related_requirements_2.Code" should never twice be the same.
Compare my .mrt file as well as Image 1 showing the designer and schematically the data Be aware also that I have NO property "processDuplicate" on my Richtext-Field. How can I process that one if duplicate?
I tried using the "processing duplicates" setting. I set a Tag value {related_requirements_2.Code} and set my processing duplicates to "Hide based on Tag". this does not hide anything. I set it also to others, e.g. "Hide based on value and tag" is making the text disappear, BUT only the text, and all the rest of the field (frame etc.) stays.
Compare image 2 showing pdf output: As you see I was able to remove the Title fields (PARAM0016 and "Tage vor SSL...") with this property without any problems! even the space is filled up. My other approach was to set the following code in the data band property (tried after print, before print, rendering, ...) and setting up a local variable "Already_Printed_Parameters0" as Stringlist:
if(Already_Printed_Parameters0.Contains(Related_Requirements_2.Code)){
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = false;
} else {
Already_Printed_Parameters0.Add(Related_Requirements_2.Code);
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = true;
}
However it showed that setting .Enabled to true or false always affected ALL items, or in other words the whole sticomponent and NOT it's instances.
Thanks a lot for helping me on how to get rid of these duplicates!
regards,
Mark
I have a component, that is being printed many times with the current data. Now within my Data source "related_requirements_2" I have duplicate item, where all attributes are exactly the same. Nevertheless attributes CAN sometimes be the same (like a true or false flag and obviously we have more than 2 data items). The important criterion is that "related_requirements_2.Code" should never twice be the same.
Compare my .mrt file as well as Image 1 showing the designer and schematically the data Be aware also that I have NO property "processDuplicate" on my Richtext-Field. How can I process that one if duplicate?
I tried using the "processing duplicates" setting. I set a Tag value {related_requirements_2.Code} and set my processing duplicates to "Hide based on Tag". this does not hide anything. I set it also to others, e.g. "Hide based on value and tag" is making the text disappear, BUT only the text, and all the rest of the field (frame etc.) stays.
Compare image 2 showing pdf output: As you see I was able to remove the Title fields (PARAM0016 and "Tage vor SSL...") with this property without any problems! even the space is filled up. My other approach was to set the following code in the data band property (tried after print, before print, rendering, ...) and setting up a local variable "Already_Printed_Parameters0" as Stringlist:
if(Already_Printed_Parameters0.Contains(Related_Requirements_2.Code)){
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = false;
} else {
Already_Printed_Parameters0.Add(Related_Requirements_2.Code);
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = true;
}
However it showed that setting .Enabled to true or false always affected ALL items, or in other words the whole sticomponent and NOT it's instances.
Thanks a lot for helping me on how to get rid of these duplicates!
regards,
Mark
