2. Pages Tips & Tricks
• Query Text
• User Defined Parameters
• Column Selection
• No Data Values
• Component Deletion
• Auto-Archiving
• Account Settings
• Auto-downgrade
• Sub-models
3. Query Text
• Text passed into a query is normally converted
to a quote-delimited string
…where portfolio_code=‘4003’
4. Query Text
• Sometimes, you just want to pass in a literal
string that you want inserted into the query
• Typically, it’s the name of a database column
Select sp.cost_base,sp.Market_….
5. User Defined Parameters
• Common way to allow users to override defaults
• Can be based on static lists or query-based
• Results can be string, string list, boolean,
numeric
• Examples:
– Override benchmark
– Starting market value for portfolio + start date
– Show lots
– Select report columns
• Define as part of document definition
7. Column Selection
• Allow users to select columns
• Makes use of xReports plus
– Query text
– User defined parameters
• Define xReport with all possible columns
• At run-time, xReport will skip over ‘missing’
columns
• Complete example (sample business unit +
sample database) including documentation on
Groupsite
8. No Data Values
• Instead of having a query fail because there is
no data, have a soft landing
• Define a ‘no data’ value that is easy to detect
• Raise a user-friendly warning, drop the
component, or otherwise handle ‘softly’
10. Component Deletion
• Use business logic to remove components that
don’t make sense given the data
• Example: remove duration-banding report if acct
has no fixed income securities
ExecQuery CountFI(portcode;PGAsOfDate) into FISecCount
If FISecCount=0 then DeleteSection endif
11. Auto-Archiving
• Clean up the status list
• Move ‘old’ statuses + files to an archive
• Searchable archive
• Enable and configure at document level
• Override at job level
• Run automatically or ad-hoc
12. Account Settings
• Define commonly used options for an account
• Numbers, strings
• Input as text box, drop down, etc.
• Examples:
– Account manager
– Date report due on
– Freeform comment
• Define on account source form
• Use anywhere you can access account details
13. Account Settings
• Use account settings in account groups!
• Example; all accounts with due date=3 days
1. Create setting
2. Define setting
3. Create group based on setting
• Select accounts, schedule accounts,…
14.
15.
16.
17. Auto Downgrade
• Make sure small ad-hoc requests are always at
the front of the queue
• If a ‘normal’ job has >N accounts, downgrade
the priority
• Ad-hoc jobs (<N accts) therefore have higher
priority
• Set default under Business Unit Settings
• Override by user/group
18. Sub-Models
• Frequent requirement in Pages implementations
• Relationship includes multiple accounts
• Need to report at aggregate level as well as at
individual account level
• Two Pages tricks:
• QueryLoop
• ExecFile
19. Sub-Models
• Query Loop calls a query and returns a
recordset that lists off all sub-portfolios
• ExecFile calls a sub-model document that is just
like a model document, but is called over and
over again from a model document
20. Sub-Models
Create a report for the master (total)
portfolio
Loop for each sub portfolio
Get basic info for sub portfolio into variables
Run a ‘sub’ model document for each
subportfolio (accessing variables set above)