100% found this document useful (1 vote)
14K views

BIRT Multi Select Parameters

These slides present the rationale why you may want to use the BIRT ScriptFunction to allow your report developers to leverage complex code, without having to understand the code.

Uploaded by

Scott Rosenbaum
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
14K views

BIRT Multi Select Parameters

These slides present the rationale why you may want to use the BIRT ScriptFunction to allow your report developers to leverage complex code, without having to understand the code.

Uploaded by

Scott Rosenbaum
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

BIRT Multi-Select

Parameters
The Safe and Easy Way

Enabling Intelligent Decisions©

1
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
BIRT Project
Our Involvement
Involved with project since
inception (2004)
OS BIRT & Actuate BIRT
BIRT PMC & BIRT Committers
BIRT World / BIRT Exchange
Our Focus
For your Product
For your Project
For Source
your at:
Enterprise 2
http://longlake.minnovent.com/repos/birt_example/innovent.birt
BIRT Services
Services
Best Practices
Design, Development &
Deployment
Remote Consulting and Support
BIRT Training
Selected Experience
Aldon
Blackboard
3
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Multi-Select the Easy Way
Multi-Select Parameters
Available in 2.2
Builds an array of values
Often Used with SQL
Constrain query to range of
values
Where state in (‘MN’, ‘NC’, ‘CA’)

4
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Implementation Techniques
JavaScript Event Handlers
DataSet Property Binding

Two Issues
Maintenance
(query & expression)
SQL Injection

5
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
SQL Injection
select * from orders where
DON’T
state in (?)

? = “ ‘MN’);

DO
drop database;
select * from dual where 1 in
(‘1’ ”

THIS
select * from orders where
state in (‘MN’);
drop database;
Source at:
6
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Parameter Binding
Supported by JDBC and all
Databases
Stops SQL Injection Attacks

select * from orders where


state in (?,?,?)

Each parameter value


requires a binding
7
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Can BIRT Do This?
Absolutely
Design Engine API
Read QueryText
Find Parameter Names / Values
Modify SQL Text to add ‘?’
Add Parameter Binding to
DataSet

8
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Can BIRT Do This Easily?
Absolutely
Use standard SQL Syntax
Use ScriptFunctionExtension
point
Build your own functions
Expose those functions in the UI
New to 2.3.1

9
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Standard SQL Syntax

Select *
From Orders
Where 0=0
-- and status in
(‘MS:parameterName’)

10
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Use the
ScriptFunctionExtension
The easiest BIRT extension
point
Extremely useful
Many simpler applications
Combining the DEAPI and
ScriptFunctions is more
difficult.
Don’t Let these examples scare
you away.

11
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
DEMO Time
Simple DEAPI Example
Add a Label to a blank design

Work with Parameters


Dynamically show parameters in
design

Multi-Select Example
In action
12
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Questions and Contact Info

Scott Rosenbaum
[email protected]
(763) 225-8418

Keith Mericle
[email protected]
(562) 698-8583

http://innoventsolutions.com

13
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt
Questions ?

Source in Subversion
http://longlake.minnovent.com/repos/birt
project: innovent.birt.functions

14
Source at:
http://longlake.minnovent.com/repos/birt_example/innovent.birt

You might also like