Home
Analytics
Creating a custom datasource
bsilverm
Hello All,
I did a lot of research and work before posting here, so please excuse me if I am asking something that I should have already read by now.
I am looking to create a good datasource I can use to create some BIRT reports against one of my applications that has a database back-end. I've created a JDBC datasource, however am only seeing the ability to execute SQL statements. What I want to do, is build a "schema" in BIRT so that I can choose from a pre-defined set of values in my back-end database. I want to define these values however, rather than use the table names and field values. For example, if one of my tables is "employees", with a field of "first name", I want to be able to create a dataset, and be presented with a list of values (ie - Employee -> FirstName). I have created a connection profile, and tried using that but it is very generic and does not appear I can customize the data source. I have looked into creating an ODA plugin, and have used the plugin wizards which generated a lot of sample java code. I feel I am missing something, or do I truly have to write java code in order to get my data source customized the way I want it? Can someone please set me straight? There is a lot of documentation, however I am not sure what I need to do to proceed. Thanks all!
- Ben
Find more posts tagged with
Comments
Virgil Dodson
Hi Ben,
Can you elaborate a bit more on what you want to see? The way I understand it, you can create SQL today to a JDBC datasource, but you would rather present to the BIRT report designer person, a list of table and field names rather than have them type SQL. If this part is correct, then there are a couple of options.
First of all, you can have someone who is effecient at SQL design a bunch of queries and have them stored in a library. The person designing the report can then choose a DataSet by it's friendly name (e.g. HR Payroll Data) and then select fields from that for the report. A downside to this approach is that the query may pull more data than is actually used on a report.
Another option that is supposed to be coming with BIRT 2.3 is a GUI query builder where users grab a table and can select fields from it. Here you will not have to know SQL to get data.
Another option you mentioned above is to use the ODA capability of BIRT to define your own custom data source/set. You can get started by using the the BIRT project wizards for creating a new ODA Runtime, and a ODA Designer project. This will create a simple ODA that you can modify. In this case, you can create any sort of screens you want, like a picklist of all the fields available to a user, and then you control the SQL going back to fetch the resultset.
Finally, a commercial alternative could be used. For BIRT reports that are deployed to the Actuate iServer Express, there is a feature/product called Information Objects. These Information Objects can be used as a data source for a BIRT report. They are very similar to what you described above where you create a schema of available tables and fields available to users and they are able to pick from these fields to create the report. Some automatic query trimming happens so that only the fields needed are selected at runtime. The Information Objects are available in the BIRT Designer for report developers... and you can also use the Information Objects with the Web Based BIRT Designer for End users.
bsilverm
Thank you for the reply!
Here is a simple example of what I would want to do:
I have a table in my application called "EMP", and a table called "Emp Types". In the EMP table is a field called "Name", and a field called "Salary". In the "Emp Types" table, is a list of types of employees. What I would like to do is have the user create a datasource to connects to my database, and then can proceed to a screen while setting up a data set that allows them to create a field mapping to "Employees" (table = EMP), and then select output columns. When clicking on "Employee Type", it will drop down a list of employee types (Full Time, Part Time, Regular), so that they can sort by, filter, etc, the employee type. Can I have a data set that dynamically pulls data by what values are in the fields in the database table? I am very interested in creating a good data source for my application without requiring that the user enter their own SQL. Thanks again!
- Ben
Virgil Dodson
To help clear things up for me, are you creating an application and want to allow your users to design their own reports from a browser.... or are you expecting your users to create their own reports in the BIRT Designer that connects to your datasource?<br />
<br />
If you are allowing your users to design reports from your application then that can get complex. In your simple example, it would not take that much effort to create a parameterized report. The parameters can be supplied from a query (for example, Employee Types would be a picklist). You can also have checkbox parameters that determine which columns from the employees table the user wants to see. This can be controlled with the visibility property of a table column. I assume your real world case involves more tables and fields and likely more complex situations. If that is the case, take a look at the demo of the BIRT Designer for End-Users at this page <a class='bbc_url' href='
http://www.birt-exchange.com/modules/products/interactive-designer.php'>http://www.birt-exchange.com/modules/products/interactive-designer.php</a>
; You can integrate this with your application so users can create the whole report themselves in the browser using your data.<br />
<br />
If, on the other hand, your users are in the BIRT Designer themselves, then you will need to use libraries of SQL queries, like mentioned earlier, wait for BIRT 2.3 with a query builder GUI, or use the Information Objects mentioned earlier.
bsilverm
Hi Virgil,
Thanks again for the reply. Yes, you are correct...the application involves more real world scenarios than those I described in my example. I am having the users create their reports from the BIRT RCP, so will not be having them create the reports in a web browser. Is there any information available on the query builder GUI coming in BIRT 2.3. Are there any details available on the ETA of this version as well? I may just wait for this as creating these data sets through. In the mean time, I will look in to BIRT Designer for End-Users as it seems like it will provide some value in the interim. Thanks again!
- Ben
bsilverm
Hello,<br />
<br />
I've answered my own question about the release of BIRT 2.3 by talking to my secret sources (reading the first line on www.birt-exchange.com telling us that 2.3 is coming out at the end of June). Thanks!<br />
<br />
- Ben
Virgil Dodson
Hi again Ben,<br />
<br />
Yes, BIRT 2.3 is almost out, I think June 26th. More information on BIRT 2.3 query build you asked about can be found at <a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/project/notable2.3.php#jump_15'>http://www.eclipse.org/birt/phoenix/project/notable2.3.php#jump_15</a>
;