Report Enhancements in TDL
Report as Message Box and Query Box
Till Release 6.x, we have used Query Box in TDL which is invoked by the actions Query Box and Query Box Ex in a function and the attribute, Control Ex in a Form definition. The current query box is fully platform controlled in terms of visuals and behaviors and it gives very little control to TDL developers to define the same.
To provide complete control of visuals and behaviors to the TDL developers, the new query box is introduced in the Report definition. With this, there are two new actions Query Report and Message Report are introduced to allow the developers to bring a customised report as a query box or a message box. To support the backward compatibility the existing actions, Query Box, and Query Box Ex are still retained in function definitions.
Action – Query Report
The action Query Report allows the developer to bring a customised report as a query box. This action is used to display a Query Box report with a specified string.
Syntax
Query Report: <Report Name>: <Query Title>: <Query Text>: [<Query Help ID>]
Where,
<Report Name> is the name of the report to display the query and its choices.
<Query Title> is the title of the message. It can be any expression that returns a string. This value will be accessible using the $$InfoString. This can be further used in the report to display the query text.
<Query Text> is the actual message to be displayed in the query box. It can be any expression that returns a string. This value can be accessed using the $$InfoParam. This can be further used to control the look and feel of the choices of the query report.
<Query Help ID> is an optional parameter. It accepts the value of the help identification number. Help ID is useful to display a message in the query report and take the user to different locations like the help page, external URLs, and so on. If you need to give any resolution for the error, internally we can link through Query Report.
Any Expression that results in Long and passed to the query box report as it’s associated HelpID for the Help-page to come up.
Example
065 : Query Report : SVUserQuery : @qrymsg
The reports like SV User Query, SV AcceptQuery, SV QuitQuery, SV Quit AppQuery, SV DestroyQuery are created in Default TDL for Query Box.
Action – Message Report
The action Message Report allows the developer to bring a customised report as a Message Box. This action used to display a message box report with a specified string.
Syntax
Message Report : <Report Name> :<Message Title> : <Message Text> : <MsgHelpID>
where,
<Report Name> is the name of the report to display the query and its choices.
<Message Title> is the title of the message. It can be any expression that returns a string. This value will be accessible using the $$InfoString. This can be further used in the report to display the message box text.
<Message Text> is the actual message to be displayed in the message box. Any Expression that results in a string and passed to the message report, where it is accessible with $$InfoParam. This can be further used to control the look and feel of the choices of the message report.
<Message Help ID> is an optional parameter. It accepts the value of the help identification number. Help ID is useful to display a message in the query report and take the user to different locations like the help page, external URLs, and so on. If you need to give any resolution for the error, internally we can link through Query Report.
Any lengthy message that to be passed to the message report as it is associated with HelpID for the help page to come up. This information can be accessed using the $$InfoHelpID. This can be further used in the report to display the message box help ID.
New TDL Attributes
Form Attribute – Grey Back
The attribute Grey Back is used to control whether the screen should be greyed-out before showing the query box or not. The default value for this attribute is FALSE.
Syntax
Grey Back : <logical value>
Where, <logical value> can be True or False.
Example
Grey Back : Yes
Form Attribute – Flush Key
The attribute Flush Key is used to control whether the keystrokes which the user may have pressed to be cleaned up or not before the query is shown to the user. This is done to avoid an un-intentional dismissal of the query box by the user.
Syntax
Flush Key : <logical value>
Example
Flush Key : Yes
Form Attribute – SubForm
The attribute SubForm is used at Form level to decide whether the message box to be placed with reference to the Form or the entire canvas. Since the message box is always placed at the right bottom corner of the canvas, this attribute will always be set to FALSE for the message box.
Syntax
SubForm : <logical value>
Example
SubForm: TRUE
Form Attribute – Sound Alert
The attribute Sound Alert is used to give a sound alert when the query box is being displayed. The attribute value can be Alarm, Warning, or Check.
Syntax
Sound Alert :<Alarm or Warning or Check>
Example
Sound Alert: Alarm
Form Attribute – Consume Key
The attribute Consume Key specifies whether the message box can consume the key pressed or return the same to the caller object (parent report) or not.
Syntax
[Form: <Form Name>]
Consume Key: < logical formula>
Where <Logical Formula> is a logical value that accepts yes or no.
Example
Consume Key : Yes
Form Attribute – Min Width
The attribute Min Width is used to set the minimum width required for the current form.
Syntax
MinWidth : <numerical expression> <UOM>
Where <numerical expression> returns a number which accepts the unit of measurement a PTS.
Example
MinWidth: ($$Windowwidth/8) PT
Form Attribute – Min Height
The attribute Min Height is used to set the minimum height required for the current form.
Syntax
Min Height : <numerical expression> PTS
Where <numerical expression> returns a number that accepts the unit of measurement a PTS.
Example
Min Height : ($$WindowHeight/8) PTS
New Functions
$$GetLongestLineLength
The function GetLongestLineLength gives the length of the longest line in the given text. The text can be separated by ‘\n’ and it will give the length of the longest text block without a newline.
Syntax
$$GetLongestLineLength : <String Expression>
Where <string expression> evaluates to a string.
Example
[System: Formulae]
SMPLMessage: “This function GetLongestLineLength gives the length of the longest line in the + given text. The text can be separated by ‘\n’ and it will give the length of the longest text + block without a newline.”
[Field: GetLongestLine]
Set as : $$GetLongestLineLength:@@SMPLMessage
$$InfoString
The function InfoString uses to extract the string from the message and query report.
Syntax
$$InfoString
Example
[Field: MsgBox Title]
Info : If $$IsEmpty:$$InfoString Then $$LocaleString:”Information!” Else $$InfoString
$$InfoParam
The function InfoParam uses to extract the string value given as a message in the action Message Report or Query Report. This function can be used in the report which can be called by the action Message Report or Query Report to display the message title of the message box.
Syntax
$$InfoParam
Example
[Field: MsgBox Body]
Info : If $$IsEmpty:$$InfoParam Then “<Msg Text>” Else $$InfoParam
$$WindowWidth
The function WindowWidth returns the current window width.
Syntax
$$WindowWidth
Example
FormQueryBoxWidth : If $$WindowWidth < 1350 Then ($$WindowWidth/16) Else ($$WindowWidth/19)
$$WindowHeight
The function WindowHeight returns the current window height.
Syntax
$$WindowHeight
Example
FormQueryBoxHeight : If $$WindowHeight < 900 Then ($$WindowHeight/13) Else ($$WindowHeight/16)
Preload Check and Preload Control
Currently, a report can be opened in any mode like display, create, or alter mode with the help of the respective actions. In case if the customer wants to open the report only when a specific condition is satisfied, then the condition is used where the action statement is mentioned. For example, the cost category report can be opened only when the cost category configuration of the company is enabled.
When these conditions to be satisfied to open a report, there should be a validation performed even before the report is loaded. To include these kinds of checks or validations or control any of the messages at the report level we have introduced two attributes called Preload Check and Preload Control at the report level.
Report Attribute – Preload Check
The attribute Preload Check used to specify a condition to be checked before launching the report. If the condition satisfies the report is launched else specified query is displayed for resolution of the failed condition.
Syntax
[Report: <Report Name>]
Preload Check : <Logical Expression> : <Query Report> : <Query String> : <QueryParam> [:<QueryHelpId>: <Action : Parameters>]
Where,
<Logical Expression> any expression that evaluates to a logical value.
<Query Report > is the Report Name used to display the Query and its choices.
<Query Srting> can be any expression that returns a string. This is passed to the query report, where it is accessible with $$InfoString. This can be further used in the report to display the query text.
<Query Param> any expression that results in a string and passed to the query report, where it is accessible with $$InfoParam. This can be further used to control the look and feel of the choices of the query report.
<QueryHelpId> any expression that results in long and passed to the query box report as it is associated HelpId for the Help-page to come up. This is passed to the query report, where it is accessible with $$InfoHelpId. This can be further used in the report to display the query box help id.
<Action /parameters> standard action and parameters, that need to be executed when the system name ‘Yes’ is returned to the platform from the query report. This is optional.
Example
[Report: PriceLevel PreloadCheck]
Variable : PriceLevel PreCheck : String : “”
Pre Load Check : NOT @@IsPriceLevelOn : SV User Query : ##PriceLevelPreCheck : “” : @@PriceLevelPreCheckHelpID : Call : PriceLevel PreCheck
Report Attribute – Preload Control
The attribute Preload Control is used to open a message box with a message and prevent opening the report if the first parameter is true. It takes the condition as its 1st parameter followed by the message box Help ID.
This attribute is like the preload check, but instead of taking a query box followed by action, it just shows a message box with the passed string based on the condition.
The attribute Preload Control is used to open a message box with a message and prevents opening the report if the first parameter is true.
Syntax
[Report: <Report Name>]
Preload Control : <Logical Expression> : <Message String> :<MessageHelpId>
Where,
<Logical Expression> can be any expression that evaluates to a logical value.
<Message String> can be any string expression whose value is to be set in the message box. This is passed to the query report, where it is accessible with $$InfoParam. This can be further used in the report to display the message box text.
<MessageHelpId>can be any expression that results in Long and passed to the message box report as it is associated with Help Id for the Help page to open. This is passed to the query report, where it is accessible with $$InfoHelpId. This can be further used in the report to display the message box help id.
Example
[Report: PriceLevel PreloadCheck]
Variable : PriceLevel PreCheck : String : “”
Pre Load Control : NOT @@CAPriceListAccess OR (NOT @@IsPriceLevelOn AND NOT @@AlterCmpAccess):+
@@AlterCmpNoAccessMsg