Reports and Execute Reports |
Overview |
|
|
This topic covers two variants of Report List and Maintenance pages that are provided with LabVantage:
• | Reports (System Admin → Reporting → Reports) lets you register new Reports and define parameters (arguments). |
• | Execute Reports (LIMS → Reports → Execute Reports) lets you run reports. |
This topic concentrates on the operation and use of the LabVantage Reporting interfaces. As provided, LabVantage uses TIBCO Jasper Reports to generate Reports. Please see Execute Reports and List Page Integration of Jasper Reports. Accordingly, the topic Using Jaspersoft Studio with LabVantage is also provided to assist in generating custom Jasper Reports. This covers operations such as:
• | Installing Jaspersoft Studio | • | Using the Wizard to Create a New Report | |
• | Creating a Data Adapter | • | PDF/A Support for Jasper Reports | |
• | Configuring a Project | • | Using Unicode in Jasper Reports | |
• | Importing LabVantage Templates into your Library | • | Rich Text Support in Jasper Reports | |
• | Importing LabVantage OOB Reports into a Project |
For a broad overview of LabVantage Reporting features, see Concepts of Reporting. Supported versions of reporting software are specified in the "Installation Requirements" section of the LabVantage Installation Documentation.
Reports |
|
|
Access the Report Maintenance page through the Report List page. There are several "Report List" pages. The example below is the SapphireReportList page at System Admin → Reporting → Reports:
![]() |
The Report Maintenance page lets you register new Reports and define parameters (arguments):
![]() |
Fields of the "Report" element:
Field | Description | ||||||||||||
Report | Identifier of the Report. | ||||||||||||
Type | Manufacturer of the reporting engine used to generate the source file: Jasper Reports, Talend, Java, or Business Objects.
|
||||||||||||
Description | Description of Report content. | ||||||||||||
Version | Version number of the Report. | ||||||||||||
Version Status | Version Status of the Report. | ||||||||||||
Location | Applicable when the Type is set to Jasper, Embedded Jasper, or BOXI. This opens a lookup that lets you choose the allowed file type (according to policy) for Jasper Reports or BO. When the Type is set to "Embedded Jasper", the Location is no longer a lookup. In this case, enter the name and extension of the file that is the 'main' report in the ZIP that you will attach using the "Report Libraries" detail tab (available after a Save). As provided, the lookup is configured to browse "client-side" (providing access to files residing on the local machine). As described below, it can also be configured to browse "server-side". This would provide access to files residing on the machine hosting the application server. The lookup mechanism involves the File Location Policy and the maint Element for the Report Maintenance page:
After you select your jrxml file, the "Location" is shown (assuming the "Custom" subdirectory in the OOB configuration) as Custom/ReportName.jrxml and saved in APPLICATION_HOME\reports\Custom. If the file already exists in the upload path, it is not overwritten; rather, it is automatically renamed using a numerical suffix (ReportNamennn.jrxml, where nnn = 001 through 00n). |
||||||||||||
Java Object Name (including package) |
Applicable when the Type is Java or Talend.
"Default Output Format" and "Add PDF Watermark" are not supported for Java/Talend report types.
|
||||||||||||
Default Output Format
Alternate Output Format |
These determine the output formats that will be available when the Report is run (see Run Report). If neither is specified, all supported formats are available. If a "Default" is specified, that will the selected format when the Report Execution dialog opens. If an "Alternate" is specified, it will also be available in addition to the default. | ||||||||||||
SDCID | This determines the Report definitions used for different SDCs. The Reports popup dialog (when running new Reports) uses this field to filter the compatible Reports for this SDC in the dropdown. | ||||||||||||
Generate Report Event | This is used to generate Controlled Reports. Setting this to Yes generates the events specified in the Report Event element. See Controlled Reports below. |
Fields of the "Report Parameters" element:
Field | Description | ||||||||||||||||||||||||||||||||||||
Param | Identifier of the parameter. | ||||||||||||||||||||||||||||||||||||
Param Name in Report | Name of the parameter as it appears in the report. | ||||||||||||||||||||||||||||||||||||
Required | When checked, the parameter is a required input. | ||||||||||||||||||||||||||||||||||||
title | title of the parameter as it appears in the report. | ||||||||||||||||||||||||||||||||||||
Type | Determines how the value of the parameter is entered in
the prompt:
|
||||||||||||||||||||||||||||||||||||
RefType | If the Type is a Reference Type, choose the Reference Type. | ||||||||||||||||||||||||||||||||||||
Param from SDC | If the Type is an SDC, choose the SDC. | ||||||||||||||||||||||||||||||||||||
Lookup URL | URL for the page used to choose the parameter value. | ||||||||||||||||||||||||||||||||||||
Param from SQL | If the Type is SQL, enter the SQL statement. | ||||||||||||||||||||||||||||||||||||
Default Value | Default value for the parameter. |
At runtime for any Jasper report, LabVantage will automatically pass the below parameters to the report engine. You may use them in your report design as query criteria, parameter values to be printed, or simply as variables for conditional formatting. If you design a new report using a LabVantage template, these parameters will be defined for you to use as required.
System Parameter | Description |
SAPPHIRE_ReportRoot | This is the starting point for all subdirectories on the application server where the report definitions can be found. LabVantage Home, Applicaiton Home, and Applicaiton Name are defined during the installation. The default Report Root is LABVANTAGE_HOME\APPLICATION_HOME\[application_name]\reports. |
SAPPHIRE_ReportPath | Path to the jrxml or jasper file on the Application Server. The report uses this parameter to locate referenced images in any subdirectories. |
SAPPHIRE_ReportName | Name of the report file when uploaded. This is taken from the OBJECTNAME column when you registered the report in LIMS. |
SAPPHIRE_ReportID
SAPPHIRE_ReportVersion |
Key Ids of the Report SDI. The Version number is used in the footer of the standard reports. |
SAPPHIRE_ReportTitle | Value for "Description" provided when you registered the report in LabVantage |
SAPPHIRE_RSETID | RSet Id passed to the report. It is expected that the report's SQL will join against records in the RSetItems table to locate SDIs to report. Using an RSet ID may be required when you have more than 256 characters to pass for KeyID1 |
SAPPHIRE_KeyID1List | The textual value(s) of the primary key(s) for items selected on a list page in LabVantage. In production, reports should use the RSet ID if it is expected that users will want the results of a query on a list page to be printed on a report. This parameter is limited to holding 255 characters. For example, if a user selects the values John, Mary, and Richard on a list page, the SAPPHIRE_KeyID1List value will be: 'John', 'Mary', 'Richard' |
SAPPHIRE_KEYID1 | The textual value of the primary key for a record selected from a list page. |
SAPPHIRE_SDCID | SDC Id for the passed-in KEYID1 or RSETID. This will be the SDCID of the calling List Page. |
SAPPHIRE_KEYID2
SAPPHIRE_KEYID3 |
Additional parts of the KEYID for muti-keyed SDCs. |
SAPPHIRE_CurrentUser | sysuserid of the current user. |
SAPPHIRE_DatabaseName | Database connection name for the database executing the report. |
SAPPHIRE_REPORTEVENTID | Identifier of the report event. This is generated by LabVantage at runtime when the report has event tracking enabled (below). This will be a combination of the Base Report Event ID and the Event Version. Example: 1000000-1 where the event number is 1000000 and this is the first time this report was run for this KEYID1 |
SAPPHIRE_BASEREPORTEVENTID | Report Event number. This number does not include the version. See Report Event ID for the unique identifier. |
SAPPHIRE_REPORTEVENTVERSIONID | The Report Event version. This will start at one and increment when a user re-executes the report for the same KEYID1.
For example, when a Report is created with a Report Event id of "1000451-1" then BASEREPORTEVENTID will be "1000451" and REPORTEVENTVERSIONID will be "1". |
SAPPHIRE_PRIORREPORTEVENTID | Identifies the Report Event ID which is the parent to this version of the report execution. Example: 1000451-1 will be the Prior Report Event ID for 1000451-2 This happens when event version 2 replaces version 1. |
SAPPHIRE_CONNECTIONID | This parameter is automatically supplied by LabVantage when a user executes the report from within the application. The LabVantage JasperReportScriptlet allows you to call the getAttachment method. This method will either render the image for picture type attachments or render a thumbnail for document attachments. Images are converted to byte data. That data is then interpreted by the report as an image and displayed. A SAPPHIRE_CONNECTIONID is required when calling the getAttachment method. This will require 6 input parameters. These are sdcid, keyid1, keyid2, keyid3, attachmentNum, and connectonId. Here is an example: $P{REPORT_SCRIPTLET}.getAttachment($F{SDCID}, $F{KEYID1}, $F{KEYID2}, $F{KEYID3}, $F{ATTACHMENTNUM}, $P{SAPPHIRE_CONNECTIONID}) Using the above as an image expression assumes that you have fields and parameters for these on your report. It also assumes that thumbnails have been generated for your attachments when you upload these to LabVantage. |
SUBREPORT_DIR | This is not a system generated value. However, you may find it in some of the example reports supplied with your installation. It is useful to define this in your report then re-use it when referring to subreports within the main report. For example, you might set SUBREPORT_DIR to "/subreports/" then simply refer to $P{SUBREPORT_DIR} + "mysubreport.jasper" within the report. |
Execute Reports |
|
|
Run Report |
"Run Report" executes the selected Report from the Report List page (System Admin → Reporting → Reports).
Some standard reports require parameters to be passed through. Examples of required parameters are KEYID1, RSETID, and SDCID. If LabVantage detects that your report accepts an RSETID parameter, LabVantage will require you to supply these. The report engine will return an error message if you do not give a required value. The SDCId and KeyId1 are always passed when you launch the report from a list page. These Reports cannot be run from Report List page (ReportExecList) because it does not pass an appropriate SDI or SDC into the Report parameters.
![]() |
First, select a Report that does not expect an RSETID.
After selecting the Report, click "Run Report". This opens this "Report Execution" dialog offering options for output file location, file format and arguments to be satisfied in the Report.
![]() |
A "Report Argument" example is shown above for the Sample Detail Report, which requires the SDI KeyId1 of the Sample to be input as an argument.
Output Format for Jasper can be "PDF", "XLSX", "XLS", "DOCX", "DOC", "CSV", "RTF", "HTML". For Business Objects it can be "PDF", "XLS", or "HTML". This depends on the Default and Alternate output format properties configured when you registered the report. If you require a PDF/A compliant format, see PDF/A Support for Jasper Reports.
"Output To" determines the destination of the generated Report:
Option | Description | |
View on local window | If the "Output Format" is "PDF",
the Report opens in a dialog window as shown in the example below. "XLSX",
"DOCX", and "CSV" stores the generated file in the browser's
download location.
|
|
Print to Printer | Choose a Printer from the dropdown, choose the Report Arguments (if required), then click "Run Report". The Report is printed on the destination Printer. | |
Email to Address | Provide the email address to which the Report will be mailed. The default filename for Reports is reportid_[currentuser]_[currentdatetime] (such as SampleDetail_ss_Jul-24-2017-10-50-45.xlsx). You can also provide your own name in the "File Name" field. When specifying a filename, you can use the tokens [currentuser], [currentdate], and [currentdatetime]. You can also use [param1] and [param2] to indicate the value of parameters (arguments). Example: [currentuser]_[currentdatetime]_[param1]_report. | |
File Name to Export | The Report will be saved on the local machine. Specify the File Name. |
About Report Parameters |
Note that to run a Report, you must specify any required "Report Parameters" (arguments). If Report Parameter "A" depends on Report Parameter "B", choosing "A" automatically populates "B". To support this "cascading population", write your query in the Report Maintenance page using this example as a guideleine:
param1 | select s_sampletypeid from s_sampletype |
param2 | select s_sampleid from s_sample where sampletypeid='[param1]' |
Here's how this example appears in the Report Maintenance page:
![]() |
Since this example indicates that param2 is dependent on param1, choosing the value of param1 populates param2. This feature is intended to be compatible with pre-LabVantage R5.1 (DM0502) Report pages.
Here's how Report Parameter selection appears:
![]() |
Note that the dropdown for param2 is empty. This is because param1 has not been chosen. If you choose a value for param1, the param2 dropdown of param2 will be populated based on the value chosen for param1.
![]() |
Example Reports |
LabVantage supplies 38 example reports with your installation. These are using the included Jasper reports engine. You may modify the report definitions found in LABVANTAGE_HOME\applications\APPLICATION_HOME\reports\OOB on your LabVantage server. Please see Using Jaspersoft Studio with LabVantage
List Page Integration of Jasper Reports |
|
|
Use the Button operations to convert the contents of a List page into a PDF or Excel report, and view one of these reports from the List page. The resulting *.jasper and *.jrxml files are stored in LABVANTAGE_HOME\applications\APPLICATION_HOME\reports\generated.
![]() |
Operation | Description |
View as PDF | Converts the List page columns into a PDF and opens Acrobat:
|
View as Excel | Exports the List page columns to a spreadsheet and opens Excel:
|
Choose Report | Prompts for the report to open, then opens the selected report:
|
Custom Report buttons can be added to an SDI List page by defining them in the "Buttons → Standard Button Properties" collection of the advancedtoolbar Element for the List page. The output format is defined by the "displaytype" rc attribute of the "Link URL" property, e.g.,
• | rc?command=viewreport&displaytype=xlsx |
• | rc?command=viewreport&displaytype=docx |
• | rc?command=viewreport&displaytype=csv |
Optionally, choose to leave off the displaytype when the Report defines its default type.
Using Jaspersoft Studio with LabVantage |
|
|
For an example configuration of Jaspersoft Studio for use with the LabVantage application, plus other information to assist in generating custom Jasper Reports, see Using Jaspersoft Studio with LabVantage.
Business Objects Report Registration |
|
|
Registering Reports |
As explained in Concepts of Reporting, LabVantage recognizes a Report only if you register it. During registration, LabVantage presents a lookup of Reports configured in the repository. After you specify a root folder in which all Reports will be stored, all Reports below this folder are shown in a Lookup page. You then choose a Report to register. After selecting the report, LabVantage looks in the BO repository to determine its parameters (arguments) and displays them in the "Report Parameters" detail. You then specify how LabVantage prompts for these values (including the Data Type). Options include dropdowns, SDC lookups, string entry, and dates. All of this is used during runtime execution of the report.
Viewing Reports through the URL |
Overview |
Any registered report can be executed and viewed through the URL
http://hostname:8080/labvantage/rc?command=viewreport&reportid=SampleDetail&displaytype=pdf
Note that "displaytype" can also be "xls" or "html".
Based on the registered prompts, LabVantage solicits information from the user. Below is a representative prompt page with a Sample Template dropdown.
![]() |
Other prompt options can be chosen, such as SDC lookups and dropdowns. The report is executed after prompts have been answered and the user clicks OK. After executing the report, the corresponding file is returned from the BOServer and presented using the BO native viewer. Below is the PDF viewer showing report results.
Suppressing Prompts |
To suppress any prompts generated by a Report:
1. | Add this parameter to the viewreport Request Controller command:
&mode=submitarg This indicates that an argument is being submitted in the URL and the prompt page should be bypassed. |
2. | Pass the arguments into the URL using the ParamNameIn Report string as
the parameter.
The parameter defined in the param column of the Report registration should be passed in (not the param name in the Report). LabVantage should then find the parameter name and substitute that during the call to BO. This provides a more descriptive definition of the parameters better than Business Object's prompts. |
Connection Test |
The System Configuration User Options (System Admin → System Configuration) contain a"Test Connection" button that establishes a connection to the BO server and tests the BO-LabVantage connection and configuration.
Controlled Reports |
|
|
Overview |
"Controlled Reports" refers to a process that generates a unique event whenever a report is:
• | Printed | • | Exported to a file | |
• | Emailed | • | Viewed |
The event records:
• | The user who triggered it. | • | What happened as a result of the event. | |
• | When it was triggered. | • | The SDIs recorded in the report. |
NOTE: | The ReportEvent records each and every execution of a Report marked as a Controlled Report. Each execution gets a unique id and may require confirmation. The full traceability to this report output is maintained by recording who and when it was reported, along with who Confirmed the report, and when. A copy of the report itself is stored in this table. |
The Reports button (available on select list pages) opens the Report History
Events dialog. This shows the details of Controlled Report Events.
See Button Operations for information about the operations available in this dialog.
In general, this feature works for both Jasper and Business Objects reports.
However, the two differ in how the Controlled Report engine finds paramnames
(arguments) and fieldnames corresponding to SDC and SDI keys. This is described
in Passing SDCs to Reports.
Mechanics |
Generating a Controlled Report creates a unique event for a ReportId, and populates these columns in the Report table:
Column | Description |
ControlledFlag | Indicates whether or not this is a Controlled Report. |
GenViewEventFlag | Specifies whether or not to generate an event when a Report is viewed. |
GenReprintEventFlag | Specifies whether or not to generate an event when a Report is reprinted. |
GenSdilogFlag | Indicates that sdcid and keyid1list have been passed into the Report. If so, the next four columns apply. |
ReportedSDC | SDC for the SDI being reported. |
Keyid1Value Keyid2Value Keyid3Value |
Values of the SDI KeyId1, KeyId2, and KeyId3. |
InitialDisposition | This value is used to populate the Disposition column (in the ReportEvent table) when the first event is triggered for a report. |
The ReportEvent table holds events:
Column | Description |
ReportEventId (PK) | Identifier for the Report event.This is automatically generated, but it uses the SequenceProcessor class to generate the AutoKey (rather than the SDI AutoKey generator). |
ReportId (FK) | Not null. |
ReportVersionId (FK) | Not null. |
CreateBy | LabVantage user who created the event. |
CreateDt | Date/time the event was created. |
ModBy | LabVantage user who last modified the event. |
ModDt | Date/time the event was last modified. |
ReviewBy | LabVantage user who reviewed (confirmed or rejected) the event. |
ReviewDt | Date/time the event was reviewed. |
EventType | Type of event.Can be view, print, email, export, reprint. |
DisplayType | How the report is displayed (pdf, excel, html). |
ParentEventId | If the event is reprint, reprint is considered the child event. ParentEventId is the identifier of the parent event (the event that previously printed the report). |
ReportPrint | Format for the printed Report (blob, pdf, excel, html, jasperprint). |
Disposition | Reference Type indicating the condition of the event (confirmed, rejected, pending). |
NOTE: Like the GenerateReport Action properties, this table also contains columns to specify Report destination (such as printerid, emailtolist, filename).
The ReportEventItem table holds:
Column | Description |
ReportEventId | Identifier for the Report event. |
ReportEventItemId | Identifier for the Report event item. |
ItemSDCId | SDC for the SDI being reported. |
ItemKeyId1 ItemKeyId2 ItemKeyId3 |
Values of the SDI KeyId1, KeyId2, and KeyId3. |
Pages |
These pages support maintenance of Controlled Reports. Both are described in the example following this section.
Page | Based on Page Type... | Description |
Report Event List | SDI Maintenance List | Lists events.
View this page from the Reports
tramline (shows all events) or an instance list page (shows the Report Events for the selected instances).
As with all List pages, use it to search for and confirm events, e.g., "search for all unconfirmed events". |
Report Event View | ReportEventView | Lists events, along with the SDIs associated with each event. This uses a dataview Element to show all report events for selected SDIs (initially grouped by SDI). Columns are configurable. Inputs are SDCId, KeyId1, KeyId2, KeyId3. |
Creating a Controlled Report |
An example of how to create a Controlled Report:
|
Go to System Admin → Reporting → Reports. |
|
The Report List page opens. Select one of the OOB Jasper Reports (this example uses SampleDetail), then click Edit.
|
|
The Edit Report page opens:
These are the fields applicable to Controlled Reports: In the Report detail:
In the Report Event detail:
When passing in SDCId, KeyId1, KeyId2, and KeyId3:
|
Example |
Here is an example using one of the OOB Jasper Reports (Sample Detail). Set and save these values, then go to the next section "Generating an Event".
Field | Value |
Generate Report Event | Yes |
Generate View Event | Yes |
Generate Reprint Event | Yes |
Log SDI Reported | No |
SDCID Value KeyId1 Value KeyId2 Value KeyId3 Value |
None (leave these blank). We will be populating the Report from an SDI List page, so we do not need to specify the SDI (as described in Passing SDCs to Reports above). |
Generating an Event |
An example of how to generate an event:
|
Go to LIMS → Samples → Manage. |
|
The Sample List page opens. Select a Sample, then click Print Sample Detail (Other Tasks Menu):
|
|
When the PDF opens, a "View" event has been generated: |
|
Close the PDF. |
Viewing an Event |
An example of how to view an event:
|
In the Sample List page, click Reports: |
|
The Report History Events page opens, showing the event:
|
Viewing a List of Events |
An example of how to view a list of events:
|
Go to LIMS → Reports → Report Events. |
|
The Report History List page opens, showing ReportEventIds: |
|
View, Confirm, Reject, ReGenerate Report and Reset To Pending work the same as in the Report Event View page (shown in Viewing an Event). |
Report Generation Checks |
If you attempt to generate a Controlled Report for a KeyId that is already associated with a Report Event you are prompted with a warning to the effect that the Controlled Report already exists.
Button | Functionality |
View Prior Report | Shows the previously generated Report |
Print New Report | Regenerates the Report and displays it.
The Report ID Version is incremented by 1 each
time the Report is regenerated. When viewing the Report History Events dialog, the Report ID includes the Version number and the "Replaces ID" column indicates the prior Report (previous version).
|
Adhoc Query Reports |
|
|
Adhoc Query Reports forward you to an Adhoc Query page. See Adhoc Queries for details concerning functionality and use.
Embedded Jasper Reports |
|
|
Embedded Jasper Reports are available when the report you want to register is not a self-contained singular file. An alternative to this approach is to use remote desktop or a file share to upload your files when available. If the report references a sub-report, image, or other external file, use the below steps to package these into a ZIP file for uploading through the Report Libraries detail.