asp.net + crystal report

G

Guest

Please I need help and dont know where to post the question.....
So I am making a small asp.net application and need to generate a crystal
report with one image that changes depending of some data.
I am using a Oracle database and for me is not important if the images are
on the hard drive or in the database... I just dont know how ti implement a
image that changes in the crystal report

Thanks in advance... kindly regards
 
L

Lucas Tam

Please I need help and dont know where to post the question.....
So I am making a small asp.net application and need to generate a
crystal report with one image that changes depending of some data.

With the vs.net version of Crystal Reports this is trick to do. But this
is how you do it:

1. Create a dataset with a BLOB column (System.Byte[] column)

Dim _dcLogo As DataColumn = New DataColumn("Logo", System.Type.GetType
("System.Byte[]"))

2. Populate the new dataset with the data you wish.

3. Stuff the graphic into the Blob column.

'Read data into a byte array
'Read data into a byte array
Try
Dim _fs As FileStream = New FileStream(_ImagePath, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite)
Dim buff(_fs.Length) As Byte
_fs.Read(buff, 0, buff.Length)
_fs.Close()

Dim _dr As DataRow = _Table.NewRow

'Put buffer into Logo Field
_dr("Logo") = buff

_Table.Rows.Add(_dr)

Catch ex As Exception

End Try


4. In the report designer, drag the blob column onto your report,
Crystal will automatically output the blob in the proper graphics format
(JPEG, GIF, etc). I've only tried using the BLOB column with JPEG
graphics.
 
L

Lucas Tam

With the vs.net version of Crystal Reports this is trick to do. But this
is how you do it:

oops, it's getting late tonight:

With the vs.net version of Crystal Reports this is tricky to do. But this
is how you do it:
 
D

Damir

I will try.. thanks...

Lucas Tam said:
Please I need help and dont know where to post the question.....
So I am making a small asp.net application and need to generate a
crystal report with one image that changes depending of some data.

With the vs.net version of Crystal Reports this is trick to do. But this
is how you do it:

1. Create a dataset with a BLOB column (System.Byte[] column)

Dim _dcLogo As DataColumn = New DataColumn("Logo", System.Type.GetType
("System.Byte[]"))

2. Populate the new dataset with the data you wish.

3. Stuff the graphic into the Blob column.

'Read data into a byte array
'Read data into a byte array
Try
Dim _fs As FileStream = New FileStream(_ImagePath, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite)
Dim buff(_fs.Length) As Byte
_fs.Read(buff, 0, buff.Length)
_fs.Close()

Dim _dr As DataRow = _Table.NewRow

'Put buffer into Logo Field
_dr("Logo") = buff

_Table.Rows.Add(_dr)

Catch ex As Exception

End Try


4. In the report designer, drag the blob column onto your report,
Crystal will automatically output the blob in the proper graphics format
(JPEG, GIF, etc). I've only tried using the BLOB column with JPEG
graphics.



I am using a Oracle database and for me is not important if the images
are on the hard drive or in the database... I just dont know how ti
implement a image that changes in the crystal report

Thanks in advance... kindly regards
 
D

Damir

Sorry still no results:(
don't know whats happening... i don't get any error but the image is not
shown... here is my code:

Try

Dim _fs As FileStream = New FileStream("c:\a.bmp", FileMode.Open,
FileAccess.Read, FileShare.ReadWrite)

Dim buff(_fs.Length) As Byte

_fs.Read(buff, 0, buff.Length)

_fs.Close()

Dim _dr As DataRow = IspisRacunaDS1.SLIKA_TABLE.NewRow

'IspisRacunaDS1 - dataset

'SLIKA_TABLE - table

'LOGo is a column of the table of a base64Binary type

IspisRacunaDS1.SLIKA_TABLE.Rows().Add(_dr)

_dr("Logo") = buff

_dr("ID") = 1

Catch ex As Exception

End Try





Lucas Tam said:
Please I need help and dont know where to post the question.....
So I am making a small asp.net application and need to generate a
crystal report with one image that changes depending of some data.

With the vs.net version of Crystal Reports this is trick to do. But this
is how you do it:

1. Create a dataset with a BLOB column (System.Byte[] column)

Dim _dcLogo As DataColumn = New DataColumn("Logo", System.Type.GetType
("System.Byte[]"))

2. Populate the new dataset with the data you wish.

3. Stuff the graphic into the Blob column.

'Read data into a byte array
'Read data into a byte array
Try
Dim _fs As FileStream = New FileStream(_ImagePath, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite)
Dim buff(_fs.Length) As Byte
_fs.Read(buff, 0, buff.Length)
_fs.Close()

Dim _dr As DataRow = _Table.NewRow

'Put buffer into Logo Field
_dr("Logo") = buff

_Table.Rows.Add(_dr)

Catch ex As Exception

End Try


4. In the report designer, drag the blob column onto your report,
Crystal will automatically output the blob in the proper graphics format
(JPEG, GIF, etc). I've only tried using the BLOB column with JPEG
graphics.



I am using a Oracle database and for me is not important if the images
are on the hard drive or in the database... I just dont know how ti
implement a image that changes in the crystal report

Thanks in advance... kindly regards
 
L

Lucas Tam

Sorry still no results:(
don't know whats happening... i don't get any error but the image is
not shown... here is my code:

remove the try statements from the code... so that an error will be thrown.

Then see what error is occuring : )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top