Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Please Help to solve the problem.
I want to insert image{Chart age that is created dyanmically} into report(.rdlc report).
Can i add or not?

I have tried this code in which i have inserted image as reportviewer background.
it is shown on form but when i export it to EXCEL Or PDF it is not shown.
Code :
<br />
Report r1 = new Report();//Report is form on which report is generated<br />
                Rectangle rr = new Rectangle(10, 10, 500, 500);<br />
                chart2.SaveImage("Image.bmp", System.Drawing.Imaging.ImageFormat.Bmp);<br />
                Image img = Image.FromFile("Image.bmp");<br />
                Bitmap bb = new Bitmap(img, new Size(100, 100));<br />
                r1.reportViewer1.DrawToBitmap(bb, rr);<br />
                r1.DExpenseTableAdapter.Fill(r1.DealerExpenseDataSet.DExpense);<br />
                r1.reportViewer1.BackgroundImage = img;<br />
                r1.reportViewer1.BackgroundImageLayout = ImageLayout.Center;<br />
                r1.reportViewer1.RefreshReport();<br />
                r1.Show();<br />
                r1.reportViewer1.Show();
Posted

I used Report viewer a long time back and MSDN helped me a lot. You check the PDF viewer whether that accepts images or not. In my case (With VS 2005) it worked. Still you check the following link


http://msdn.microsoft.com/en-us/library/ms251715(v=vs.80).aspx[^]
 
Share this answer
 
Comments
uspatel 14-Jul-11 7:18am    
it does'nt work with dynamic images.
Images will be changed dynamically in my case.
Ok. So, please write a Report Refresh() function. Call that once again. I faced the same with a gridview
 
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