Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have problem in display image from access 2007 database to rdlc

i work in windows form c# vs2015

Actually i need to display image from database to more records from access 2007

but i cannot

in rdlc i do as following :

In RDLC

drag image control to
report source database
mime type jpeg
set EnableExternalImages = true
=First(Fields!qrimg.Value, "DataSetImage") for value
Name as Name of column in dataset .

In dataset

qrimg system.Byte[]

on interface

in button click view report
C#
reportViewer1.LocalReport.EnableExternalImages = true;
            QrClasses q = new QrClasses();
                DataSetImage printexcel = q.GetDataImage();
                ReportDataSource datasource = new ReportDataSource("DataSetImage", printexcel.Tables[0]);
                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(datasource);
                this.reportViewer1.RefreshReport();

C#
public DataSetImage GetDataImage()
        {
            
            using (OleDbConnection con = new OleDbConnection(connection))
            {
                using (OleDbCommand cmd = new OleDbCommand("SELECT UserID,UserNameAR,CountryAR,MemberAR,qrimg FROM AllPrinting"))
                {
                    using (OleDbDataAdapter sda = new OleDbDataAdapter())
                    {
                        cmd.Connection = con;
                        sda.SelectCommand = cmd;
                        using (DataSetImage dsimage = new DataSetImage())
                        {
                            sda.Fill(dsimage, "DataTable1");
                            return dsimage;
                        }
                    }
                }
            }
        }

Final result i can show all data from access 2007 in report but image cannot display

can any one help me please if possible

i do every thing but really cannot show image .


What I have tried:

How to display image from access database 2007 although all data display in rdlc
Posted
Updated 9-Mar-17 5:19am

1 solution

Have a look at How to: Add a Data-Bound Image (Reporting Services)[^].

Pay particular attention to the section To remove the OLE header from an Access image:
=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value),105))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900