Pages Tips and Tricks Rick Sands
Pages Tips and Tricks
Rick Sands
Pages Tips & Tricks
• Query Text• User Defined Parameters• Column Selection• No Data Values• Component Deletion• Auto-Archiving• Account Settings• Auto-downgrade• Sub-models
Query Text
• Text passed into a query is normally converted to a quote-delimited string
…where portfolio_code=‘4003’
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_….
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
User Defined Parameters
• Example: list of columns to show on report
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
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’
No Data Values
If tot_si = 0 then DeletesectionEndif
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
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
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
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,…
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
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
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
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)