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.
Thanks for the suggestion, that may ultimately be my only option.
The problem is this involves dozens (and dozens) of potential objects (reports, lists, details, etc.) and I was hoping to avoid modifying each of them. I created my own print function to slap the watermark on the provided Datawindow/Datastore and it's working great - except for anything with a nested report . I may wind up touching those nested dataobjects.
1) Create 2 DWO's - one for user viewing and a duplicate DWO setup for printing.
2) Load the print DWO into a DS
3) Use a ShareData() command to share the buffer from DC's DWO to the DS's DWO.
4) Print the DWO in the DS
5) Turn the ShareData OFF
Food for thought. ;-)