Book Image

ADempiere 3.6 Cookbook

Book Image

ADempiere 3.6 Cookbook

Overview of this book

Table of Contents (16 chapters)
ADempiere 3.6 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Using the context in a report


JasperReports allows us to add parameters to a report and their values can be passed by the caller. For example, we can create a parameter, momId, in the report and allow the user of the report to pass the value for it at runtime. Moreover, inside the report, different decisions (for example, filtering data) can be taken at runtime based on the parameter value. When we use a Jasper report inside ADempiere, it passes the following to every report:

  • Current context

  • Parameters specified in the report

  • RECORD_ID: The primary key of the current record. This is passed as Integer

  • AP_INSTANCE_ID: The ID of the current process. This is passed as Integer

  • CURRENT_LANG: The current language. This is passed as String

While others are more straightforward, in this recipe, we will understand the steps it takes to use the ADempiere's current context in a Jasper report.

How to do it...

  1. 1. Launch ADempiere and click on the Tools | Preferences option on the top menu bar.

  1. 2. On the...