Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

i am developing a web application, and using rdlc reports. I want to print rdlc report direct on button click with preview in reportviewer.

i have used the following reference

http://msdn.microsoft.com/en-us/library/ms252091%28v=VS.90%29.aspx[^]

i am getting generic error in following line
" Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]);"

Please help.Thanks.
Posted
Comments
Prerak Patel 19-Sep-11 2:20am    
Any details about error?
meghamaharshi 19-Sep-11 2:48am    
error code -2147467259
exception - Generic error occured in GDI+

1 solution

If so, the parameter of the call, your stream does not contain a valid metafile. If this is a file stream, try to name a file with some application which can read EMF or WMF. I would recommend Inkscape, http://en.wikipedia.org/wiki/Inkscape[^], http://www.inkscape.org/[^].

If this is a stream of some other kind, copy it to a file stream and save as a file, check it up the same way.

You could have recorded metafile incorrectly prior to having this problem, it happens due to a bug in System.Drawing.Imagine I came across in .NET 2.0; don't know how about other versions.

See http://stackoverflow.com/questions/732810/save-metafile-in-c[^], but take into account: the conclusions of the authors of the answer are incorrect: it is possible to record a meta-file using .NET. I used to solve this problem, but as I need time to find out my solution and as I'm not sure this is your problem, I will wait for your question if you confirm that this is your problem.

—SA
 
Share this answer
 
Comments
meghamaharshi 19-Sep-11 6:05am    
Well i dont know whats the prb but facing error when meta file is created.

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