Trackable reports allow a report to be tracked when printed, emailed or exported (logged in History) from a security point of view, and records the number of times this has happened, providing printed X times functionality on reports, etc.
By default, all reports are not tracked, and must be flagged as Trackable to enable this functionality.
It is recommended to only flag key reports as trackable, based on either your security requirements, or if printed X times functionality is required (eg. picking slips). |
Whenever a trackable report is previewed/printed/emailed/exported, a history log entry is made that includes the following information:
▪Date and time report invoked.
▪User who invoked the report.
▪Related Jim2 object type (job, quote etc).
▪Related Jim2 object number (job no, quote no).
▪Report event (print, preview emailed, etc.).
▪Report path and name.
Marking a Report Trackable
To mark a report as trackable, open Report Designer via Tools > Report Designer. Choose the report you wish to flag as Trackable and select Properties from the ribbon. From the Properties form, change the Trackable report property to True.
Viewing a Trackable Report’s History
If a report is trackable and related to a Jim2 object (job, quote etc), the report log is displayed within the history of that object. For example, if a picking slip was printed for Job#16, the log of that is displayed when viewing the history of Job#16.
For reports that are not related to an object, or to see any trackable reports, select Report Tracking as the object in the Tools > History selection criteria.
Accessing Trackable Report Variables via Report Designer and Scripting Engine
One of the benefits of marking a report as trackable is the ability to display how many times it has been printed on the actual report.
Several variables are now available within Report Designer, via the JimSystem report pipeline, to enable this functionality.
Report DataPipeline |
Report Variable |
Type |
Description |
JimSystem |
ReportTrackable |
String |
T if report is trackable |
JimSystem |
ReportTrackable_ExportCount |
Integer |
Number of times exported |
JimSystem |
ReportTrackable_PreviewCount |
Integer |
Number of times previewed |
JimSystem |
ReportTrackable_PrintCount |
Integer |
Numbers of times printed |
Typically, you would add a Label component to a report, and add an OnGetText event to that label with RAP code as follows:
procedure LabelTrackableOnGetText(var Text: String)
begin
Text := ‘’;
if (JimSystem[‘ReportTrackable’] = ‘T’) and (JimSystem[‘ReportDestination’] = ‘Printer’) then
begin
if JimSystem[‘ReportTrackable_PrintCount’] = 0 then
Text := ‘First time printed’
else
Text := ‘Report print count = ‘ + IntToStr(JimSystem[‘ReportTrackable_PrintCount’]);
end;
end;
The following properties are available within the Scripting Engine via the ReportLogger object;
ReportLogger.IsLogging
ReportLogger.PrintCount
ReportLogger.PreviewCount
Reportlogger.ExportCount
Sample Scripting Engine code:
if (ReportLogger.IsLogging) and (ReportLogger.PrintCount = 0) then
begin
// first time printed
...
end;
Further information:
Add a Signable Report for Jim2 Mobile |
|