Is it possible to dynamically change the datawindow syntax for a nested report in the group header datawindow?
I have a header and footer on a nested report. I want to be able to assign the datawindow syntax to the nested report at runtime. I am storing the datawindow syntax in the database. Approaches I have attempted so far were not successful.
Previously this was achieved by adding the custom datawindow objects to a library. The library was dynamically added to the library list through "AddToLibraryList". With our move to PowerServer deployments we need to replace this approach.
Thank you
One way that I can think of (I have not tested this approach BTW) would be (my best guess here) ...
1) Create a new PBL that has all the child DWO's in it that "could be used", so that the PS Compiler builds all the proper related C# stuff.
2) At App runtime, use the SetLibraryList() command to remove the child DWO PBD used in the step #1 compile.
3) Use the LibraryCreate() command to create an empty PBL
=> I would also use the FileExists() and FileDelete() commands to blow away any previous PBL instance.
3) Use the AddToLibraryList() command to add the PBL to the App's library list for the PB Loader
=> That should now condition the PB Loader as to where to find the "latest" child DWOs.
4) Grab the DWO source you need from the DBMS and use the LibraryImport() command to create any DWO's you need in the new PBL "on the fly".
=> As long as they have the same Class Name & SQL as in Step #1, that should be OK. - but they can then have their own look & feel (ie: text, labels, column positions, headers, footers, expressions, etc). As long at the expected result set is the same, then that should not matter..
5) Now have your PS App run the Nested Parent DWO's as normal.. The PB Loader should now find the corresponding child DWOs in the new PBL where the dynamic child DWOs were just created. They "should" execute OK DML wise via their Web API call & return the JSON result sets (Parent & children) from the Web API call (as expected from Step#1). Then the PS App on the client machine should then render the JSON result sets GUI wise.
In theory (just off the top of my head), I "think" that this should work. Food for thought.
Regards .. Chris