|Set variable values from Master Page and use across pages [message #1805349]
||Fri, 12 April 2019 07:51
| Adrian HUANG
Registered: April 2019
We have Master Page in the library for all reports to link with to print in a consistent framework.|
We want to print different logos based on who runs the report, and the user/logo mapping information is stored in the database.
Now we are able to
• Obtain the user name from the HTTP request of the report launch
• In the Master Page's logo image element's OnCreate event, use a script to create a dataset and query the database and obtain the logo image URL, and then
• In the logo image's OnRender event, set the image URL to print the correct logo on the Master Page.
So basically we are able to implement the required functionality.
If the report output ends up having many pages, with the current design, on every page when printing the logo a database query will be fired and this may impact performance.
I am thinking to use a variable to store the logo URL obtained from the database query that is fired at the first page logo print, and then all logo printings on subsequent pages will skip the query if this variable is already set.
We set up an experiment to script in the OnCreate event of a Label element in the Master Page to obtain the current value of a variable (of one of those aforementioned types), increase by 1, and then put back. And then script the Label's OnRender event to print the variable's current value. We expect each page to print increasing values, but in fact all pages just print the initial value. This appears to me like that each page instance generated from the Master Page is isolated and they don't share a comment context that can carry values across page instances.
I understand that setting values of a Page Typed Page Valuable from the report content and then consuming it in the Master Page can realize the functionality of print different values on each page, for example page number by group. However, setting value of a Page Variable (page type or report type) from Master Page doesn't seem to be able to carry the effect across pages.
How can we do that? We need this entire mechanism to be done in the Master Page itself and cannot depend on report specific data, because this is a generic Master Page in the report library, linked by all reports.
Or can someone refer a resource that explains the generation process of Master Page page instances in detail, and the relationship with the report contents?
Powered by FUDForum
. Page generated in 0.01648 seconds