I had a standalone C# assembly for creating data matrixes (2D barcodes) and it exported as a bitmap. This is really no different from loading a bmp from disk.
There are a few issues with this:
Assuming that you have already created your assembly...
Development environment (may also be reporting server):
Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblie
Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
- Open the report that will reference the custom assembly.
- On the Report menu, click Report Properties.
- In the Report Properties dialog box, click the References tab.
- Under References, click the ellipsis (...) button that is next to the Assembly name column header.
- In the Add References dialog box, click Browse. (In SQL Server 2005, click the Browse tab.)
- Locate and then click the custom assembly. Click Open. (In SQL Server 2005, click Add instead of Open.)
- In the Add References dialog box, click OK.
- In the Report Properties dialog box, click OK.
This custom code will also need to convert the bitmap to a byte array...
- Right click the report and choose properties. Select the Code tab and enter code similar to the following :
Public Function GetMatrixImage(ByVal code As String) As Byte()
Dim photo as System.Drawing.Image
photo = myAssembly.GetTheImage(code)
Dim ms AS System.IO.MemoryStream = new System.IO.MemoryStream()
photo.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
Dim imagedata as byte()
imagedata = ms.GetBuffer()
return imagedata
End Function
- Set Source = Database
- Set MIMEType = image/bmp (from the pulldown)
- Choose Expression from the Value drop down. In the Expression editor enter :
No comments:
Post a Comment