[CrystalReports] VB.NET workaround - insert a picture into a report based off a file path

A

Anne DeBlois

Hi,

We are developing an application based on an MSDE database. We want to
create various reports such as a printable catalog that contains pictures.
Because our application will ship with over 3,000 high-resolution pictures
(300-dpi TIFF files), they will be stored in the database using their file
path (ex.: \images\picture0049364782.tif), because of the 2GB data
limitation of MSDE.

We cannot use SQL server because the application is a single-user one, the
database is to be stored on the workstation, and having our customers set up
a full SQL Server in order to just run the app is definitely not an option,
as the TCO would be way too high.

I got this article from the BusinessObjects' knowledge base:

http://support.businessobjects.com/library/kbase/articles/c2014707.asp

The sample code provided is Visual Basic 6 project. I tried to "upgrade" the
project to VB.NET, but got an error message stating that Crystal Reports 9
is missing (as a reference), because we have the .NET version.

I am desperately searching for equivalent code I can use, that works with
VB.NET or I want to add this code from scratch, but I don't know what to
write ;-)

Thank you so much in advance!!!!!!!

ANNE DEBLOIS
 
B

Brian Bischof

Hi Anne,

The problem is that there are different version of CR and different
development tools and this makes everything hard to understand which one to
go with. I have complete code in my book but it spans a few pages and it
isn't a simple copy and paste issue. Here are the steps you need to take to
get this working:

1) Create a DataSet object that reads in your records.
2) Manually add a blob column to the DataSet object.
3) Create the XSD file using the new DataSet structure.
4) Build the report using the new XSD file.
5) Loop through all the records and load the TIF file into the Blob column
of the dataset for each record.
6) Pass the DataSet to the report.
7) Viola! Pictures. :)

So you can see that this is more involved than what can be posted in the
newsgroups. But if you understand the steps above then you will be able to
get it to work.

HTH,

Brian Bischof
www.CrystalReportsBook.com
 

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

Top