This is a migrated thread and some comments may be shown as answers.

Export image column

3 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 28 Feb 2012, 11:02 AM
I have to export a radgridview (winforms) with an image column.
I have stored in sql database the image and I defined the column like this:
gv.MasterTemplate.Columns["image"].Width = 120;
gv.MasterTemplate.Columns["image"].DataType = typeof(Image);
gv.MasterTemplate.Columns["image"].ImageLayout = ImageLayout.Zoom;

I can see the images without problem in the radgridview, but if I try to export grid with telerik reporting (Q3 2011), I cannot see image (in the column cells it write "System.Drawing.Bitmap")
this is the code that I use when I create the table to export from the masterview:
System.IO.MemoryStream stmBLOBData = new System.IO.MemoryStream((byte[])gridViewTemplate.Rows[row].Cells[cell].Value);
Image image = Image.FromStream(stmBLOBData);
tableRow[cell] = image;

thanks all,
Marco







3 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 02 Mar 2012, 02:56 PM
Hello Marco,

Thank you for writing.

I suppose that you are using RadGridReportingLite to export RadGridView to our Reporting tool. I am not able to understand your exact goals very well and therefore I would kindly ask you to provide me with more information about them. If exporting to Reporting is not what you are actually looking for, but instead you need to export to PDF or print RadGridView's data, I am happy to inform you that these features are natively supported by RadGridView and you do not need to export it to Reporting first. Exporting to PDF was introduced in Q2 2010, and printing RadGridView's data was introduced in Q1 2012.

If these tips still do not help you achieve your goal, please describe your scenario in greater detail. We may find an easier path than the path you have followed.

I am looking forward to you reply.

All the best,
Ivan Petrov
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Marco
Top achievements
Rank 1
answered on 05 Mar 2012, 02:01 PM
I've install Q1 2012.
Now I tried to do a simple ExportToPDF with ExportVisualSettings=true but in the pdf file the image column contains "System.Bitmap" string instead of the images.
The column is defined like this:
gv.MasterTemplate.Columns["image"].DataType = typeof(GridViewImageColumn);
and contains a db column (sql type image)
how can I export a image column?

thank you
0
Ivan Petrov
Telerik team
answered on 08 Mar 2012, 10:55 AM
Hi Marco,

Thank you for your reply.

Currently, we do not support exporting images. I can only provide you a solution that will export images with ExportToHTML. 

I have logged this feature in our Public Issue Tracking System - PITS. You can track its progress and add your vote/comment for it on the following link - PITS Feature.

I have also updated your Telerik points for the good suggestion.

Should you have other questions, I would be glad to assist.

All the best,
Ivan Petrov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
General Discussions
Asked by
Marco
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Marco
Top achievements
Rank 1
Share this question
or