Hello all!
I use VB.NET and Crystal Reports and I need to create a win report which will display pictures.
The issue is that I don't know what pictures should be printed while I design the report, but my application check this in runtime.
What I want to do is create a report that will get pictures by parameters or by any other way that will allow me to add pictures dynamically during runtime.
I heard about OLE Picture but I didn't find how to use it and I don't even sure that I should use it...
May someone explain me how to create such report?
Thanks in advanced,
Tom.Hi Tom,
Problem with Crystal and pictures is that there's no way (up until 8.5) to dynamically add a picture from a file or folder location.
You can, however, create a field in a table structure within your database to store BLOBs (BinaryLargeObjects) such as pictures or binary streams etc, and then embed that field within your report. That's provided your database supports the storage of binary objects.
So if you have a table for Personnel, and the Fields are Id, LastName, FirstName, Address etc, and you wanted to show a picture of the person, you would add a BLOB field named Pic to this table and then store the picture in it. Then when you show the person's details on the report, you will have the picture field available to select from the field list in Crystal, and pop it on the report in the appropriate location.
Some databases support storage of BLOBs 2 ways - directly storing the picture itself, and storing a file reference to a location within the file system.
You'll have to work out which way is gonna work for you.
Good luck
Dave|||I am having this same problem.
When you say "field list" are you refering to the dataset *.xsd file that is created in VB.NET 2002 that is populated from a SQL query and used and the record source for the crystal report?|||Raven (nevermore!)
I don't use Crystal and .NET, so I can't say absolutely yes to your question, but my theoretical understanding is that the schema is exposed via XML, so that anything in the underlying tables on the server side would be visible to the user as a "field".
The real issue here is that your connection can expoise a BLOB. If it can, you store the pictures in a table on the server and then retrieve thme to client side as what is essentially a binary stream. On the client side you have a container that can display binary stream data (like a picture box), and you load the binary data into that object.
Dave|||Thank You.
I have read the pictures into a SQL table via a binary stream and I have now read that data into Crystal Reports via a binary stream.
I have decided that I will bypass storing the pics in the database and simply store the path to the pics in the database and still perform the binary stream read into Crystal Reports.
thank for the help!
(" 'Tis some visitor," I muttered, "tapping at my chamber door;
Only this, and nothing more.") :p|||Raven,
One less midnight dreary, pondering weak and weary over one of those damned Crystal Reports!
My 11yo daughter's fave poem.
Glad to help - streaming is an often misunderstood feature, and once you master the mechanics of it, it's so useful. I first came across it coding with Intersystems Cache OO database, and it was very useful overcoming Crystal's problems with dynamic pictures.
Don't forget to rate the thread......
Dave
"Nameless here for evermore"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment