Adding Bitmap column to the report results in exception
Hello,
I need to put images into the Report.
This is how I add my data to the report.
All seems to work fine, but on Report preview I get the following exception:
I am using the FastReport .net Demo.
Thank you for your help,
Samser
I need to put images into the Report.
This is how I add my data to the report.
  DataSet set = new DataSet("Analysis");
  DataTable table = new DataTable("Prescription");
  table.Columns.Add("Dosage", typeof(int));
  table.Columns.Add("Drug", typeof(string));
  table.Columns.Add("Patient", typeof(string));
  table.Columns.Add("Date", typeof(DateTime));
  table.Columns.Add("Image", typeof(Bitmap));
  table.Rows.Add(25, "Indocin", "David", DateTime.Now, BitmapFromBitmapSource(analysis.Containers[0].Picture.bitmap));
All seems to work fine, but on Report preview I get the following exception:
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
  at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
  at System.Drawing.Image.Save(Stream stream, ImageFormat format)
  at LJq97BqNfhDBrWDL44.Bs6RPQ9dnFvpdU2SVr.F2coevif0(Image  , Stream  , ImageFormat  )
  at FastReport.PictureObject.Serialize(FRWriter writer)
  at FastReport.Utils.FRWriter.Write(IFRSerializable obj, Object diff)
  at FastReport.Utils.FRWriter.Write(IFRSerializable obj)
  at iMpcT7FWOi3nF4dvsFN.pKH0WXF7BLDue8VV6KZ.T7E2zBtlqvC(Base  , XmlItem  )
  at iMpcT7FWOi3nF4dvsFN.pKH0WXF7BLDue8VV6KZ.T7E2zBtlqvC(Base  , XmlItem  )
  at iMpcT7FWOi3nF4dvsFN.pKH0WXF7BLDue8VV6KZ.pxd2zHoEBq6(BandBase  )
  at FastReport.Preview.PreparedPages.AddBand(BandBase band)
  at FastReport.Engine.ReportEngine.rZK7T5KYOI(BandBase  )
  at FastReport.Engine.ReportEngine.mGs7YnYVbf(BandBase  , Boolean  )
  at FastReport.Engine.ReportEngine.J7377McmnA(BandBase  , Boolean  )
  at FastReport.Engine.ReportEngine.ShowBand(BandBase band)
  at FastReport.Engine.ReportEngine.hjo7uwpM11(DataBand  , Int32  )
  at FastReport.Engine.ReportEngine.MFT7b1SYnC(DataBand  , Int32  , Boolean  , Boolean  )
  at FastReport.Engine.ReportEngine.Vkw7nxWo1t(DataBand  )
  at FastReport.Engine.ReportEngine.R7y9xGnb5S(BandCollection  )
  at FastReport.Engine.ReportEngine.Sgd9IAJfco(ReportPage  )
  at FastReport.Engine.ReportEngine.eo692vGe00()
  at FastReport.Engine.ReportEngine.f747QvKEgI(ReportPage  )
  at FastReport.Engine.ReportEngine.Gd676X6KgR(Boolean  , Boolean  , Boolean  , ReportPage  )
  at FastReport.Engine.ReportEngine.Crh7BGcFCI(Boolean  , Boolean  , Boolean  )
  at FastReport.Report.Prepare(Boolean append)
  at FastReport.Report.Prepare()
  at Dmp1CFjdpWXGsfSJaxN.fKVqNSjHKkBKo69fyXb.DxUIa7IWsVw()
Oddly if I leave the error message open and switch a few times through my windows I can see the image on the designer. On closing the error window it vanishes.I am using the FastReport .net Demo.
Thank you for your help,
Samser
Comments
in your .net :
in frx file :
in frx file, databand :