I have been tasked with adding a watermark to printed documents.
Before printing, I copy the dataobject into a local datastore, copy the data (RowsCopy), add the watermark to the background (Modify("CREATE...")), and then make the background for each of the objects transparent (Modify("<name>.Background.Transparency='100'")), so the watermark is visible.
My problem is nested reports. I need to reach into those reports and make the background of each of those objects transparent as well.
As an example, I have a nested report object, dw_1, and an object on that report, last_name, that needs a transparent background.
These all work:
lds_print.Object.dw_1.Object.last_name.Background.Transparency="100"
lds_print.Object.dw_1[1].Object.last_name.Background.Transparency="100"
DWbject ldwo
ldwo = lds_print.Object.dw_1[1]
ldwo.Object.last_name.Background.Transparency="100"
But I need to be able to do this dynamically, I am not going to know the names of the objects in the nested reports.
None of these work:
lds_print.Modify("dw_1[1].Object.last_name.Background.Transparency='100'") >>>
Line 1 Column 5: incorrect syntax.
lds_print.Modify("Object.dw_1[1].Object.last_name.Background.Transparency='100'") >>>
Line 1 Column 12: incorrect syntax.
lds_print.Modify("Object.dw_1.Object.last_name.Background.Transparency='100'") >>>
Line 1 Column 47: incorrect syntax.
lds_print.Modify("dw_1.Object.last_name.Background.Transparency='100'") >>>
Line 1 Column 41: incorrect syntax.
lds_print.Modify("dw_1[1].last_name.Background.Transparency='100'") >>>
Line 1 Column 5: incorrect syntax.
lds_print.Modify("dw_1.last_name.Background.Transparency='100'") >>>
Line 1 Column 34: incorrect syntax.
Am I missing something, am I not going to be able to do this dynamically?
Any input is appreciated.
If I was starting with a new dataobject, that is exactly what I would do. But unfortunately these are existing, years old, objects and I am trying avoid touching every one of them. Or at least those with nested reports.
Thanks for the suggestion.