on 01-19-2009 5:47 AM
I am storing the logo of my customer in the database(SQL Server 2005) in binary format.I use VS2005 for developing my application.I would like to use the logo from the database in all the crystal reports(which are already connected to concerned stored procedures) i use .
Can anyone tell me how i could accomplish that using c#.Net.
regards,
sunitha
Hi Sunitha,
Try with this code:
Add data into the dataset
ds.DataTable1.AddDataTable1Row(id, GetImageData(ofdImage.FileName), userName)
' GetImageData function
Private Function GetImageData(ByVal fileName As String) As Byte()
Dim fs As System.IO.FileStream = New System.IO.FileStream(fileName, IO.FileMode.Open, IO.FileAccess.Read)
Dim br As System.IO.BinaryReader = New System.IO.BinaryReader(fs)
Return (br.ReadBytes(Convert.ToInt32(br.BaseStream.Length)))
End Function
Regards,
Shweta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes,only a formula can solve this,but the problem is that there is no way to find x co-ordinates of a field in crystal report associated with VS2005 or crystal report 9.0.
Do you have any idea how to achieve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I linked a sample report to the master table that stores the logo(only 1 row exists for this table,but logo can be null or get updated from time to time),dragged the blob firld to the report(it asked for a link between the current stored procedure and the master table,which i ignored).The image is now getting displayed and i am able to suppress theield when null.I dont know whether this is the right method.
I also want to know whether you can set the position of another field based on whether the image is null or not.
thanks in advance...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.