I know there are similar questions about this topic,but somehow I'm not able to crack this.
I googled this issue and got lot of references but none of them worked for me :-(
I'm creating a crystal report which i will be using for badge printing.
Everything is fine except i want a barcode in the report which is not showing up.
I'm creating this barcode in runtime and saving it in the datatable which i bind to the report.
I know there are two ways to do that.
and I'm able to get the image using OLE Object,by specifying the Graphic property of the object to the database field which contains the path of the image.
but the Problem with this approach is that, i have to save the image and the number of badges can go up to 1 lakh and i don't want to save 1 lakh image files on sever.
Rather i want to go for the other approach,To bind the Byte[] field to report but somehow that is not working for me.
Here is the code.
System.IO.MemoryStream strmem = new System.IO.MemoryStream();
bc.Save(strmem, System.Drawing.Imaging.ImageFormat.Tiff);
Byte[] mybit = new Byte[strmem.Length];
strmem.Read(mybit, 0, Convert.ToInt32(strmem.Length));
dt.Rows[0]["Barcode_Image"] = mybit;
where dt is the table that i bind to the report and "Barcode_Image" is the System.Byte[] field which contains the byte[] form of barcode image
I already have the Crystal Report Image handler in my web config.
Webconfig: Assemblies
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
</assemblies>
HTTPHandler in System.web
<httpHandlers>
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
HTTPHandler in System.webServer
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
</handlers>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Note: I'm using visualstudio 2010
kindly guide me,whee am i going wrong