Skip to main content



      Home
Home » Archived » BIRT » Frequently Asked Questions (Data)
Frequently Asked Questions (Data) [message #59697] Mon, 18 July 2005 23:34
Eclipse UserFriend
Greeting,

I compiled the recent Q & A in the BIRT newsgroup and divided them into
categories. You could take a look at the page, perhaps it could help you
get out of stuck :). More infomation could be found in the BIRT FAQ page.

Thanks to all the BIRT community members.

Regards,
Nina

------------------------------------------------------------ --
Data issues

(Note: If you got confused about the answer, you could send E-mail
directly to the person who answered the relevant question.)


Q: Are “Group By” and “Aggregate” functions possible in SQL?

(Answered by gxue@actuate.com ) If you are interested in the Flatfile data
source - the query text language used by that data set is "SQL-like". It
doesn't support GROUP BY, WHERE, ORDER BY etc.

For JDBC data sources, the SQL is passed to the JDBC driver for execution,
so whatever SQL that's valid for your DBMS is supposed in BIRT.


Q: How do I programmatically set the parameter value?

(Answered by gxue@actuate.com ) You should use the Engine API in
org.eclipse.birt.report.engine.api package. The JavaDoc for the package
has examples at the bottom of the first page. In particular, the
IRunAndRenderTask interface may be a good starting point.


Q: How do I use multiple parameters in BIRT?

(Answered by gxue@actuate.com ) You can't pass a list of values to this
query using SQL parameters:
SELECT * FROM company WHERE comp_id IN (?)
However, you can use BIRT Scripting to compose a dynamic SQL to set the
multiple parameters. Use the BIRT code editor to edit the "preOpen" method
of you data set, and type in something like this:
var valueList = " (100, 101, 102) "; // This list can be
created
dynamically based on user input
// The next line alters the SQL query of the data set at runtime
queryText = "SELECT * FROM company WHERE comp_id IN " + valueList;


Q: Is it possible getting database's information from a DataSource object
with the API?

(Answered by gxue@actuate.com) The best way to achieve this is to edit the
beforeOpen script of the data source object to set the runtime information
of the data source. To do this, right click on your JDBC data source and
select "Edit Code". In the method dropdown list, select "beforeOpen". In
the code editor, write a script like this:
extensionProperties.odaUser = "sesame";
extensionProperties.odaPassword = "open";
extensionProperties.odaURL = "jdbc:my_data_source:....";
extensionProperties.odaDriverClass = "com.mycompany.jdbc.Driver";

Refer to the BIRT ROM scripting spec for more information about scripting
ingeneral. The names of the properties that you can set (odaUser,
odaPassword, etc.) are defined by the ODA extension. The BIRT-shipped
ODA-JDBC driver extension recognizes the above 4 properties.
Previous Topic:Frequently Asked Questions (Chart)
Next Topic:Frequently Asked Questions (Designer)
Goto Forum:
  


Current Time: Sun Jun 08 17:00:51 EDT 2025

Powered by FUDForum. Page generated in 0.04696 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top