Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
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

Product type Book
Published in Jul 2010
Publisher Packt
ISBN-13 9781849511667
Pages 360 pages
Edition 1st Edition
Languages
Author (1):
John Ward John Ward
Profile icon John Ward
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 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 ₹800/month. Cancel anytime