Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
BIRT 2.6 Data Analysis and Reporting

You're reading from   BIRT 2.6 Data Analysis and Reporting Create, Design, Format, and Deploy Reports with the world's most popular Eclipse-based Business Intelligence and Reporting Tool

Arrow left icon
Product type Paperback
Published in Jul 2010
Publisher Packt
ISBN-13 9781849511667
Length 360 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John Ward John Ward
Author Profile Icon John Ward
John Ward
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

BIRT 2.6 Data Analysis and Reporting
Credits
About the Author
About the Reviewers
1. Preface
1. Getting Started FREE CHAPTER 2. Installing BIRT 3. The BIRT Environment and First Report 4. Visual Report Items 5. Working with Data 6. Report Parameters 7. Report Projects and Libraries 8. Charts, Hyperlinks, and Drilldowns 9. Scripting and Event Handling 10. Deployment

Setting default parameter values


One of the most commonly asked questions over the past few years in the newsgroups have been "How can I set a date parameter to default to the current date?"

Before BIRT 2.5, this was not an easy task to accomplish. However, new to BIRT 2.5 is the ability to set a date parameter's default value via script. Let's go about it:

  1. 1. Create a new report called defaultParameterValueReport.rptdesign.

  2. 2. Create the Classic Cars Sample Database Data Source.

  3. 3. Create a dataset called dsOrderRange, with the help of following query:

    select
    *
    from
    CLASSICMODELS.ORDERS
    where
    CLASSICMODELS.ORDERS.ORDERDATE between ? and ?
    
  4. 4. Link the two dataset parameters to report parameters called prmStartDate and prmEndDate. Make sure the two dateset parameters and two report parameters are of type Date.

  5. 5. Open the editor for prmStartDate. In the drop-down box next to Default value, select Javascript Syntax and continue.

  6. 6. Use the following script in the expression builder. Don't worry...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime