InetSoft Product Information: Accessing Report Elements Programmatically

There are very few reasons to manipulate the visual properties of elements programmatically, as these can be set in the Designer and dynamic behavior can be programmed using the Script features of the Designer. However, there may be cases where we need to bind data to these report elements programmatically. Each report element has a unique ID. The ID is set on the property dialog in the Designer, or returned by the 'add' method for the element. Once the template has been successfully imported to a ReportSheet object, it is possible to access any element using its element ID.

InputStream input =
 getClass().getResourceAsStream("/templates/report1.srt");
Builder builder =
 Builder.getBuilder(Builder.TEMPLATE, input);
ReportSheet report = builder.read(".");

ReportElement elem = report.getElement("Text2");
TextElement telem = (TextElement)elem;

Once the element object is obtained, it is possible to access the methods of the element to set its properties and attributes, or write code for complex data processing logic.

Binding Data to a Report Template

If data binding is not specified in a template, the data must be supplied to the report elements at runtime. Associating a data object with an element using the unique element ID performs the runtime data binding. The ID is set in the Designer property dialog and is also returned from the 'add' element function.

The main method for data binding is setElement(). The setElement() method takes an element ID and a value parameter. The element ID must be unique for each element on a report.

Which data types are acceptable for the element depends on the type of element referred to by the element ID. The following element types and data types are supported by the setElement() method:

Table 5. Data Types Associated with an Element

Element Type Data Types
Section TableLens, Object[ ][ ]
Table TableLens, Object[ ][ ]
Form FormLens, Object[ ][ ]
Text String, TextLens
TextBox String, TextLens
Painter Image, Component, Painter
Subreport ReportSheet

Example: setElement

An example of using setElement():

ReportSheet report = ...; // load in a template 
// set the contents of 'table1' 
report.setElement("table1", new JTableLens(jTable1)); 
report.print(...);   

If the ID specified in the setElement() method does not exist in the report template, a NoSuchElementException is thrown. If the data type does not match the element type, an IllegalArgumentException is thrown. Since report templates are normally static and would not change from development to deployment, these types of errors are normally very easy to detect.

Since a report template can store all the static data and attributes in a report, it is generally only necessary to call the setElement() method a few times (and often, just once) when setting up a report. This design greatly reduces the programming involved in creating reports and removes the tedious process of laying out report elements by trial and error.

More Resources About Reporting

  • Using the Report Explorer with Interactive Reports

    This article details how end-users can engage with report content through the “Report Explorer” interface, enabling filtering, sorting, and searching directly from the dashboard. It describes how non-technical users can hide or rearrange columns, apply filters, and explore data without needing to edit the underlying design. The example uses the “Interactive” report to illustrate how multiple sort criteria and browse/search panels can enhance exploration. The article underscores how providing interactive capabilities at run time boosts user autonomy and reduces dependence on IT. It also highlights limitations such as when section elements or complex crosstabs cannot be manipulated through the explorer.

  • Embedding Interactive Forms into Reports

    This piece explains how reports can include interactive form elements—such as text fields, radio buttons and combo boxes—to capture user input and steer the content that’s rendered. It walks through how to create a form, assign the ‘Form Name’ and ‘Field Name’ properties, and tie controls to scripting or server-side handling. The article distinguishes between client-side presentation of the form and server-side processing of the submitted values. Including interactive forms in reports enables parameterized customization, dynamic behavior and a more conversational style of data exploration. The guidance positions this as a key feature for dashboards and reports that require user-driven interaction rather than static views.

  • Advanced Interactive Data Searches Within Reports

    This article describes how the reporting platform supports powerful interactive data searches, in both Basic and Advanced modes, within an existing report context. Users can open a search panel, enter terms (such as names or dates), and drill directly to matching elements of the report, which are highlighted and navigated to automatically. The example uses an “Interactive” report to illustrate the workflow, showing how results appear and how advanced search conditions can filter by data type or set. Interactive data searches allow users to find insights quickly without building a new query or report each time. The article underscores how search capability enhances usability and supports ad-hoc exploration.

  • Hiding and Reordering Columns in Interactive Reports

    This article explains how users can hide, show or reorder columns interactively in a report via the Report Explorer interface. It provides step-by-step instructions on how to activate the column selection toolbar, uncheck or re-order fields and then refresh the display to reflect the changes. The example uses the “Interactive” report and shows how even rows grouped by a field (e.g., Geography) can have detail rows hidden to simplify the view. By enabling interactive manipulation of columns and grouping, more agile and focused insight is possible. The piece emphasizes how empowering end-users with these controls reduces report redevelopment and gives them greater flexibility.

  • Deploying Online Interactive Dashboards for Self-Service BI

    This solution-oriented article introduces how web-based interactive dashboards enable self-service business intelligence, allowing users to view and manipulate data without heavy IT involvement. It outlines how the company’s online interactive dashboard supports drag-and-drop design, browser-based access and unlimited data-size support because the engine is server-based. The key interactive features include brushing, filtering, selection lists and immediate refresh of visuals in response to user actions. The article argues that when dashboards are truly interactive, they drive adoption and faster insight because users can ask their own questions and adjust views on the fly. It further positions the deployment flexibility (cloud, browser) as enabling these interactive dashboards to reach any user device or role.

  • Exploring the Interactive Visualization Gallery Examples

    This evaluation-style article invites users to explore live interactive dashboard examples from a gallery, spanning use cases like call-center management, real-estate development and airport operations. Each example emphasizes interactive features such as selection lists, drill-downs, and dynamic filters to explore multiple dimensions and measures simultaneously. The purpose is to demonstrate how interactive dashboards can provide rich, self-directed exploration rather than static snapshots. By clicking through live examples, users gain a feel for how interactivity flows in real usage rather than theoretical descriptions. The article encourages hands-on evaluation and showcases diverse industry contexts to illustrate versatility.

  • Leveraging Interactive Dashboard Selection Lists

    This article details how selection lists and trees in dashboards serve as both input and output controls, enabling rapid exploratory workflows where user selection changes the downstream data display in real time. It walks through an example where a ‘State’ list and a ‘Company’ list are linked; selecting states dynamically updates which companies are compatible, with visual indicators like green boxes for compatibility. The interactive behavior lets end-users explore data relationships visually without scripting or redesign. The article highlights how interactive list controls extend the notion of dashboards from fixed visuals to adaptive, responsive analytic tools. It positions selection lists as a hallmark of rich, interactive dashboards that support discovery and exploration.

  • Designing Interactive Drill-Down Reports for Insight

    This piece explains how interactive drill-down functionality enables consumers of reports and dashboards to move from summary to detail by clicking on visual elements or hyperlinks. The example uses the “Interactive” report and describes how a user can click on a bar in a chart or a company name in a list to open a popup drill-down or navigate to additional detail. It explains how proper design allows multiple hyperlinks per element, pop-up menus for ambiguous links, and parameter-driven workflows for deeper inquiry. By enabling interactive drill-down, dashboards become gateways rather than static boards, facilitating exploration and root-cause analysis. The article emphasizes designing visuals and navigation paths with interactivity in mind to maximize value for users.

  • Deploying an Interactive Reporting Tool for Web and Mobile

    This article describes how the interactive reporting platform delivers rich interactivity in reports via web deployment, enabling users to click, drill, filter and navigate in reports like they would in dashboards. It positions the tool as an interactive alternative to static paginated reporting, and notes that both online and offline distribution options are supported. The benefit is that end-users gain presentation-quality reports that also act as launch points for interactive exploration or decision-making rather than final endpoints. It underscores how interactive reports help reduce IT backlog by letting users perform tasks themselves. The article argues that combining interactive dashboards with interactive reports closes the gap between operational reporting and exploratory analytics.

  • How to Use Maps in an Interactive Dashboard

    This how-to focuses on the interactive use of map visualizations within an interactive dashboard environment: users can zoom, pan, pick regions and save map state so that the next time the dashboard loads it starts at the chosen view. Controls include a control panel toolbar and click/drag behaviors. The article demonstrates how geospatial interactivity—map navigation, selection, layering—enhances dashboards for location-sensitive data such as marketing or field operations. It highlights how saving the user’s view state supports personalization of interactive visuals. Including interactive maps broadens the definition of dashboards beyond static charts to spatial discovery tools.

  • Building Interactive Monitoring Dashboards for Real-Time Insights

    This article describes how interactive monitoring dashboards combine multiple components—viewsheets, reports, KPIs, gauges—into a single screen tailored for real-time observation and action. The example describes how users can subscribe to dashboards, enable auto-refresh and configure visibility of tabs, enabling continuous monitoring rather than periodic review. The article outlines how interactive dashboards help keep users aware of shifts or anomalies in operational performance, enabling faster response. It emphasizes managing the dashboards themselves—enabling/disabling tabs, ordering them, and loading them dynamically—as part of interactive design. The piece positions monitoring dashboards as a key interactive tool for performance management, not just static reporting.

  • Deploying Interactive Dashboards for Data Science Projects

    This article argues that interactive dashboards are a valuable tool in the data science context, letting analysts or business users dynamically explore the results of predictive models, filter by variables, and connect to large or streaming data sources. It describes scenarios where dashboard users can change feature inputs, view model output in real time, and visualize what-if scenarios through interactive controls. The article emphasizes end-user adoption of interactive dashboards when the tools support self-service rather than requiring advanced scripting or coding. It presents interactive dashboards as a bridge between advanced analytics and everyday business decision-making. The piece stresses that interactivity is more than filters: it’s about enabling exploration, not just consumption.

We will help you get started Contact us