Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel


Panel
borderColororange
bgColoryellow
borderWidth1
borderStylesolid

Report Setup and Jasper Custom Reports

Getting Started with Jasper Reports

Info

An old video introduction may be helpful if you have never worked with Jasper iReport or Jasper Studio before. Jasper Reports with VetView (2015)  Although Jasper iReport has changed, the basic terms and layout are still the same in the current version.  A PDF version of this is also available at Building Custom Reports with iReport. 

Download the most recent version of Jasper iReport Designer or Jasper Studio

First, ensure that Java 8 or 11 has been installed on the computer you are using, before attempting to download and install iReport or Studio.

As of November 2021, the last supported version of iReport is 5.6 and may be downloaded for free from Sourceforge:  https://sourceforge.net/projects/ireport/files/latest/download

However, VetView has found that version 5.1 of iReport has all the features needed and may be easier to use, and does not have some compatibility issues the same way 5.6 does. 

Jasper Studio Community Edition may be downloaded from:  https://sourceforge.net/projects/jasperstudio/  The latest supported version for VetView is Studio 6.12.2.  Although the layout is slightly different from iReport, you should still be able to follow along with the tutorial video linked above. 

Connect to your installation of VetView

No matter which version of iReport or Studio you use, you will need to connect to your installation of VetView using a Database JDBC Connection.

Contact your hospital or IT department's database administrator to find the exact credentials and URL you will need to use to make this connection.

Once your database connection is set, you can begin creating a new report, or modifying an existing VetView system report.

Warning

You may need to install the Oracle driver on your local system in order for the connection to launch.   Contact VetView if you have trouble finding or downloading this driver.

Types of Reports

SQL Reports are the most common and flexible type of reports.  Any Oracle/PostGres SQL query should be able to get the data for these reports.

JavaBean Reports use pre-formatted data from VetView.  They are easier to use, but not as flexible as raw SQL reports.

Most VetView system reports use Javabeans. 

Modifying VetView System Reports

If you want to make some simple changes to a report that shipped with VetView, you can download the JRMXL and Jasper files, and then re-upload them as a custom default version.

On the Report Setup screen, open the report you want to modify, and click on the Download buttons to save the files to your local machine.

The JRXML file is the editable version of the report that you load and modify in Jasper Studio or iReport.  The Jasper file is the compiled version of the report that VetView can run.  We recommended that both be uploaded and downloaded together, so that if any changes are made, they are made to both files equally.  (Otherwise the versioning of your reports may become incorrect.)

Jaspersoft Layout

Open the JRXML file that you want to modify. 

In the example below, the system Patient Label has been opened in Jasper Studio.

The key panels visible are the Repository Explorer which contains the data adapter to connect you to the VetView server, the Outline of the report that has all the configurable parameters, fields, and contents of the Details row, and the Main Report panel which displays the actual layout. 

Dataset and Query

SQL reports have a query in the background.  (If there are errors in the query, the report cannot run.)

Right click the name of the report and choose Dataset and Query.

This is where you can create the SQL query, verify the data that the report will pull, and define the parameters that the report can use.  These parameters are then matched into VetView under Report Setup.

  • VetView tables appear on the upper left pane
  • Write the SQL query on the upper right pane
  • Define the parameters in the lower pane


Add Parameter in Jasper

In the context of Jasper reports used in VetView, a Parameter is an additional condition that you want to select at the time the report is run, rather than hard baking it into the report.  This allows you to set start dates and end dates, to run the query against specific products or line items, or specific employees, clients, or units.  

Click on the Add button on the Query and Dataset window to create a new parameter to be used in the query.

View existing Parameters in Jaspersoft iReport or Studio

A list of the parameters associated with the report are visible in the left panel under the Outline window in your Jasper workspace.

On this tree, additional parameters can also be configured in Jasper by selecting Parameters > New or Create Parameter depending on your version.

Please see our iReport tutorials for more information about how to create parameters in the local report from scratch.  Note that only the parameters included in the Local Reports Parameters in VetView are supported. 

Local Reports Parameters in VetView  

Info

These parameters may not necessarily correspond to Java Beans.  A full list of available Java data bean types is available under our Labs Admin page:  JavaBean Data Types for Jasper Reports

For some Local Reports, you can set the Parameters that will be prompted for under the Local Reports screen when the report is selected by defining them in report setup.

The Type is the type of parameter that the report will feed from VetView to Jasper.  All dates must be of the type Java.util..date.

The Label is how it will appear loaded into VetView.

The Name is the link between the Jasper report and the VetView database.  The name should match what was set in iReport or Jasper Studio when you defined the parameter. 

The Default Value may be useful for certain reports that usually have one primary variable, but may need another on occasion, 

Image Removed

These parameters built into VetView are:

Parameter Type

Jasper Field type

Example in Vetview

Example in Jasper

Visual on Local Report

Date Range

Java.util.date

startDate, endDate

a.date_created between $P{startDate} and $P{endDate}

Textjava.lang.StringDiagnosisuse "keyword" as a search query :  Where LOWER (cm.description) like '%$P!{keyword}%'  to search for the string nameNumberjava.lang.DoubleminVaue, maxValueWhere c2.client_total between nvl($P{minValue},0) and nvl($P{maxValue},999999999)String Listjava.util.ListDateJava.util.dateFiscal QuarterFiscal YearAdjustment Typesjava.lang.String$P{ADJUSTMENT_TYPE}Adjustment Types ListValue Listjava.util.Listrequest questionsEmployeeJava.util.Stringemployeewhere e.emp_id = $P{empID}Employee Listjava.util.ListUnitjava.lang.LongunitIDwhere oi.service_unit_id = $P{unitID}Unit ListInventory Locationjava.lang.Stringlocation_nameInventory Location ListCatalog ItemCatalog Item ListProductProduct ListProduct Linejava.lang.Longproduct_lineWhere l.product_line = $P{product_line}Product Line ListProduct Seqjava.lang.LongseqAnd m.product_seq_id = $P{seq}ClientClient Typejava.lang.StringclientTypeAND lower(t.client_type) = nvl(lower($P{clientType}),lower(t.client_type))Client ListResultResult List


Insert excerpt
Setup & Admin Guides
Setup & Admin Guides
nopaneltrue

Info

To see commonly used terms in VetView Hospital, please visit our Hospital Glossary of Terms.


Panel
titleContents

Table of Contents