LanAnh
asked on
CrystalDecision.CrystalReport - How to dispay an image from Blob field in MySQL using VB.NET?
Hi experts,
How can I display an image from a Blob field in MySQL on report through CrystalDecision.CrystalRep ort using VB.NET.
I have set up a report in VB.NET using CrystalDecision.CrystalRep ort. The report source is from one of the tables in a dataset. This dataset is updated during run-time. Data Type for the image in the dataset is hexBinary and the image is stored in MySQL with type mediumblob. Somehow all other fields in dataset are displayed on the report except for the image.
Please help!
Many thanks
LA
How can I display an image from a Blob field in MySQL on report through CrystalDecision.CrystalRep
I have set up a report in VB.NET using CrystalDecision.CrystalRep
Please help!
Many thanks
LA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi emoreau,
The comments in the code mention about creating schema for designing the report. I can't view the schema in this example as it is no longer exist after the report is created. I'd like to know what is the data type in the schema equivalent to System.Type.GetType("Syste m.Byte[]") .
I have included in my project a schema DatasetSource.xsd which have many tables for many other reports purpose. The table that hold the image (JPEG), I set the data type is hexBinary. In my code when I pass the table look like this:
dsReport.Tables.Clear()
dsReport.Tables.Add(New DatasetSource.asset_genera lDataTable )
rs.Open(sqlMain, cnn, ADODB.CursorTypeEnum.adOpe nStatic, ADODB.LockTypeEnum.adLockO ptimistic)
recordsetToDataset(rs, dsReport, "asset_general") 'other procedure to tranfer data from recordset to dataset
rpt.SetDataSource(dsReport .Tables("a sset_gener al"))
Can you find any thing wrong? as the image is not shown in the report.
Many thanks!
LA
PS. Thanks mlmcc. I am investigating your info
The comments in the code mention about creating schema for designing the report. I can't view the schema in this example as it is no longer exist after the report is created. I'd like to know what is the data type in the schema equivalent to System.Type.GetType("Syste
I have included in my project a schema DatasetSource.xsd which have many tables for many other reports purpose. The table that hold the image (JPEG), I set the data type is hexBinary. In my code when I pass the table look like this:
dsReport.Tables.Clear()
dsReport.Tables.Add(New DatasetSource.asset_genera
rs.Open(sqlMain, cnn, ADODB.CursorTypeEnum.adOpe
recordsetToDataset(rs, dsReport, "asset_general") 'other procedure to tranfer data from recordset to dataset
rpt.SetDataSource(dsReport
Can you find any thing wrong? as the image is not shown in the report.
Many thanks!
LA
PS. Thanks mlmcc. I am investigating your info
ASKER
Hi emoreau,
I have found my problem in my procedure recordsetToDataset.
row(i) = rs.Fields(i).Value
I modified the code to readBytes when it read the column contains the image
It works perfectly now.
Thanks alot .
LA
I have found my problem in my procedure recordsetToDataset.
row(i) = rs.Fields(i).Value
I modified the code to readBytes when it read the column contains the image
It works perfectly now.
Thanks alot .
LA
http://support.businessobjects.com/communityCS/TechnicalPapers/cr9feat_ver.pdf.asp
mlmcc