Jaspersoft Report Editing Essentials
- Kyle Robert L Nelson
Dataset and Query Editor
This is where SQL queries can be written to supply your reports with information. You can navigate to this window by right-clicking the Report Title in the Outline View (bottom-left of screen). Database queries can be written on the right side of the default tab with fields associated with the query listed below. Ensure that a Data Adapter has been set up and chosen from the drop menu in the top-left of the window. The "Read Fields" button will populate the fields associated with your query, and also acts as a good "sanity check" to ensure nothing is wrong with the query or the data adapter.
The Dataset and Query Editor has a dedicated button in the top-right of the Report Editing Area. Next to it is the "Compile" button used to generate a .jasper report from the .jrxml you have been working on. The Preview tab below the Report Editing Area will display the .jasper report.
In the query editing view, the Outline tab will display your query in outline form showing explicitly which tables and fields are being addressed by each clause. The Diagram Tab will provide a graphical diagram of the tables and fields being called and their relation to one another.
The tabs at the bottom allow even more options like adding and editing Parameters.
Design Palette Basics
The Palette view should feel familiar to anyone with experience in InDesign and other creative publishing software. Elements can be inserted, deleted, moved, resized, etc. Fonts, sizing, text color, etc. can also be chosen. The range of options stretches from basic essentials to powerful tools such as subreports and multiple graphic chart styles and visualizations.
An important and easy to miss distinction is between a "Text Field" and "Static Text" element. The former is a text box where information from Fields and Parameters can be generated. The latter is a conventional text box that does not accept a variable.
Outline View
The usefulness of this view scales exponentially with the complexity of your report. Not only are all report elements laid out and organized, you can also interact with them from this view. You can drag and drop elements from other views into elements in the outline e.g. Text Field from the Palette View into the Detail band. Elements within the Outline View can also interact with each other. Moving a Query Field into the Detail band will automatically populate a Text Field containing the Query Field variable into the appropriate area of the Report, and, in addition, will automatically populate a Static Text with the Query Field name in the Column Header band. From there, you can right-click either of these elements to alter aesthetic options as well as more robust features involving formatting and other options. Most of the work for a report can be accomplished within the Outline View and by pulling elements from other Views into Outline View elements.
Most everything in Jaspersoft Studio can interact via drag-and-drop. A powerful aspect of this software is the ability to use different views in tandem to affect the report. Additionally, most everything can be right-clicked to open a menu of useful options. There is a lot of redundancy built into the navigation of the program's features allowing the user to choose what workflow works best for them. With a blank report, take some time to right-click things and explore the different buttons and options.
Subreports
Among the Palette options, the subreport will likely be a commonly used tool. It's a powerful option that creates a child report which can be placed within a parent report. It makes its own SQL query generating its own information. Typically a subreport will contain a SQL clause dependent upon a parameter that is passed down from the parent report when the two are linked. A common example would be a Field in the parent report passed into the subreport as a parameter.
In the example below we have the query and dialogue editor open for a report that will be used as a subquery. The SQL call contains a parameter that has been added in the WHERE clause. This is the placeholder that expects a value from the main report - a client id.
The subreport can also run as it's own report without linking to a parent report. The WHERE clause would have to be satisfied by either altering it, deleting it, or by providing a value for the client id parameter when the report is run. Since the client_id parameter is marked as "Is For Prompt", Jaspersoft would prompt us to enter a value for the parameter after compiling and running the report.
VetView Wiki Most recent releases of VetView: Version 4.2.5 Hotfix (Released 10/31/2024)
To see commonly used terms in VetView Hospital, please visit our Hospital Glossary of Terms.