Using the API for Report Refreshing

InetSoft's reporting software includes an API for programmatic control of report generation. In dynamic business environments, where data changes frequently, having an up-to-date report is crucial for informed decision-making.

Programmatically refreshing a report ensures that the latest information is reflected, maintaining the accuracy and relevance of insights. This automation not only saves time that would otherwise be spent manually updating reports but also enhances the efficiency of data-driven processes. Moreover, it facilitates seamless integration with other systems or applications, fostering a cohesive and interconnected data ecosystem.

#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

The createReport() method is called whenever a request to generate a report is received in the repository. If a replet needs to change the report contents within an event handling code, it needs to inform the repository to refresh the report.

addRepletSelectionListener("refresh", null,
                    new RepletSelectionListener() {
   public RepletCommand valueChanged(SelectionEvent e) {
      // change report contents
      ...
      regenerate(); // refresh the report object
      return RepletCommand.refresh();
   }
});

The regenerate() call causes the repository to call the createReport() method with the last RepletRequest. If the createReport() has never been called before, it passes an empty request. The createReport() should return the new report object.

If a refresh() command is issued without a call to regenerate(), the web viewer will reload all pages from the repository. However, since the repository caches the report object internally, it will still return the original contents.

The reprint() command is similar to refresh() except that the report is reused to generate output, without re-executing the queries in the report.

The regenerate() call is only necessary if the replet initiates the refresh itself. All repository-initiated requests automatically refresh the internal cache.

Replet API

The core replet API is defined in the Replet interface. It consists of methods to:

  • Initialize a replet object.
  • Generate report snapshots.
  • Return report parameters.
  • Handle viewer events.
  • Destroy a replet object.

The API defined by the Replet interface is very generic and constitutes the minimum API necessary to support the replet functions. To make creating replets easier, we created a higher level API, BasicReplet, by encapsulating the common functions in high-level methods.

InetSoft products provide out of the box support for directly deploying a template as a replet (without writing any code) using a class called 'TemplateReplet'. You may also use the BasicReplet as the base class for your replets, as we do in our examples. In this chapter, we will start with a very simple replet and add features to it along the way.

What Reports Would a Developer of Accounting Software for Consultants Include?

A developer creating accounting software for consultants would design reports that cater to the unique needs and workflows of consultants, ensuring comprehensive financial visibility and efficient management. Some essential reports might include:

  1. Income Statements:
    • Overview: Summarizes revenues, expenses, and profits over a specific period.
    • Purpose: Provides a snapshot of financial performance, helping consultants understand their profitability.
  2. Expense Reports:
    • Overview: Breakdown of incurred expenses categorized by type (travel, supplies, etc.).
    • Purpose: Helps consultants track and manage their spending, facilitating budget control.
  3. Client Invoicing:
    • Overview: Details of services provided, rates, and total amounts owed by each client.
    • Purpose: Aids in billing clients accurately and maintaining a clear record of transactions.
  4. Accounts Receivable Aging:
    • Overview: Displays outstanding client payments categorized by aging periods.
    • Purpose: Assists in monitoring and prioritizing collections to maintain healthy cash flow.
  5. Time Tracking Reports:
    • Overview: Records billable hours, project-wise time allocation, and billable rates.
    • Purpose: Enables consultants to invoice clients accurately and assess time utilization for project management.
  6. Balance Sheets:
    • Overview: Presents assets, liabilities, and equity at a specific point in time.
    • Purpose: Offers a holistic view of the company's financial position.
  7. Tax Compliance Reports:
    • Overview: Summarizes taxable income, deductions, and any other relevant tax information.
    • Purpose: Aids in tax planning and ensures compliance with local tax regulations.
  8. Profitability Analysis by Client/Project:
    • Overview: Compares revenue generated versus expenses for each client or project.
    • Purpose: Assists consultants in identifying profitable ventures and optimizing resource allocation.
  9. Bank Reconciliation Reports:
    • Overview: Compares the company's records with bank statements to ensure accuracy.
    • Purpose: Identifies discrepancies and ensures financial integrity.
  10. Budget vs. Actual Reports:
    • Overview: Compares planned budgets with actual expenses and revenues.
    • Purpose: Assists consultants in managing finances against predefined targets.
Previous: Introduction to Executable Reports