Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to retrieve different blob images from database?(BIRT does not browse through mySQL blob images in a table linked with the dataset)
icon5.gif  How to retrieve different blob images from database? [message #558758] Tue, 14 September 2010 11:08 Go to next message
Vincent  is currently offline Vincent Friend
Messages: 3
Registered: October 2009
Junior Member
Hello everyone.

I am coming back to Birt after 6 months of inactivity or so. Not sure that I am facing a bug, and would like your advice in case I am confused.

I have a table in mySQL, with 7 columns and 2 records (!). This is for trial purpose.

The columns are
Field Type
ID int(10)
When datetime
Who int(11)
Direction bit(1)
Pic1 longblob
Pic2 mediumblob
Movie longblob

In Birt, I have a datasource connected to my db server, and a dataset fetching the 2 rows of the table described above. It seems all right in the preview, although it is very hard to identify the pictures...

I built a report, including a table, with 4 columns. In the detail row, col1 is for ID, col2 for When, col3 for Pic1 and col4 for Pic2.

ID and When display the correct different information from both records. The problem is that the same set of pictures (from first record) is displayed for both rows, besides the different ID.

Of course, I checked that the content of the second record is really different with Toad, and it is! No mistake there.

What did I wrong?

Thank you for any hint.

Vincent.

Re: How to retrieve different blob images from database? [message #558914 is a reply to message #558758] Tue, 14 September 2010 20:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Vincent,

Is the dataset used more than once in the report?
Can you create a blank report with one table tied to the dataset

Jason


On 9/14/2010 7:08 AM, Vincent wrote:
> Hello everyone.
>
> I am coming back to Birt after 6 months of inactivity or so. Not sure
> that I am facing a bug, and would like your advice in case I am confused.
>
> I have a table in mySQL, with 7 columns and 2 records (!). This is for
> trial purpose.
>
> The columns are
> Field Type
> ID int(10)
> When datetime
> Who int(11)
> Direction bit(1)
> Pic1 longblob
> Pic2 mediumblob
> Movie longblob
>
> In Birt, I have a datasource connected to my db server, and a dataset
> fetching the 2 rows of the table described above. It seems all right in
> the preview, although it is very hard to identify the pictures...
>
> I built a report, including a table, with 4 columns. In the detail row,
> col1 is for ID, col2 for When, col3 for Pic1 and col4 for Pic2.
>
> ID and When display the correct different information from both records.
> The problem is that the same set of pictures (from first record) is
> displayed for both rows, besides the different ID.
>
> Of course, I checked that the content of the second record is really
> different with Toad, and it is! No mistake there.
>
> What did I wrong?
>
> Thank you for any hint.
>
> Vincent.
>
>
Re: How to retrieve different blob images from database? [message #558948 is a reply to message #558914] Wed, 15 September 2010 06:10 Go to previous messageGo to next message
Vincent  is currently offline Vincent Friend
Messages: 3
Registered: October 2009
Junior Member
Good morning Jason.

Thank you very much for your interest. As I am only considering to build that report, it really is just a very minimal report: nothing but a single page, containing nothing but a single table, connected to the only dataset, which is the only one to be connected to the only data source... I could not imagine anything simpler.

However, I tried to "trick" Birt after my message, modifying the SQL in the dataset (adding a where clause - WHERE ID = 1; WHERE ID > 0), adding an order by clause (ORDER BY When), then checking what would happen with a grid. No change.

I also tried changing the blob length of the Pic2 field, then removed the binding with Movie, aso. At a certain point, Birt returned a couple of errors, but the pictures were displayed properly in the table.

Therefore, I tried rebuilding the table from scratch, and it suddenly works fine. The difference I can see is that instead of being bound to the dataset itself, my image elements are now bound to the "Container's Data Set" .

So to summarize, in case it helps anyone, the right way to do this is:

1. Insert a table in the report, then bind it to the dataset

2. Insert Image elements in the detail cells of the table, then accept the default binding choice for the dynamic image, which must be the Container's Data Set.

If you try reversely, ie binding the image element to the dataset, then the table to the dataset to avoid the error Birt is announcing, you report will run, but the only pictures you will presumably see for all the records are the ones from the first record in the dataset.

Hope this helps.

Thanks again.

Vincent.
Re: How to retrieve different blob images from database? [message #559089 is a reply to message #558948] Wed, 15 September 2010 14:55 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Vincent,

Thanks for posting. I believe this error has been fixed in the latest
builds of birt.

Jason

On 9/15/2010 2:10 AM, Vincent wrote:
> Good morning Jason.
>
> Thank you very much for your interest. As I am only considering to build
> that report, it really is just a very minimal report: nothing but a
> single page, containing nothing but a single table, connected to the
> only dataset, which is the only one to be connected to the only data
> source... I could not imagine anything simpler.
>
> However, I tried to "trick" Birt after my message, modifying the SQL in
> the dataset (adding a where clause - WHERE ID = 1; WHERE ID > 0), adding
> an order by clause (ORDER BY When), then checking what would happen with
> a grid. No change.
>
> I also tried changing the blob length of the Pic2 field, then removed
> the binding with Movie, aso. At a certain point, Birt returned a couple
> of errors, but the pictures were displayed properly in the table.
>
> Therefore, I tried rebuilding the table from scratch, and it suddenly
> works fine. The difference I can see is that instead of being bound to
> the dataset itself, my image elements are now bound to the "Container's
> Data Set" .
>
> So to summarize, in case it helps anyone, the right way to do this is:
>
> 1. Insert a table in the report, then bind it to the dataset
>
> 2. Insert Image elements in the detail cells of the table, then accept
> the default binding choice for the dynamic image, which must be the
> Container's Data Set.
>
> If you try reversely, ie binding the image element to the dataset, then
> the table to the dataset to avoid the error Birt is announcing, you
> report will run, but the only pictures you will presumably see for all
> the records are the ones from the first record in the dataset.
>
> Hope this helps.
>
> Thanks again.
>
> Vincent.
>
Previous Topic:The setting of the XML data source file in the java code
Next Topic:Dynamic table column width from dataset
Goto Forum:
  


Current Time: Fri Apr 19 21:09:33 GMT 2024

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

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

Back to the top