Passing Images to a Crystal report from VB.Net

I'm using Crystals Reports for Visual Studio.Net.  I want to pass an image to a report as a parameter.  I have placed an empty bitmap ICROleObject on my report, but I can't see how to set this from within my program.  Can anybody help?  Thanks.
useless_eaterAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
In other versions of VB and CR you use the LoadPicture

Look at
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr9_vb_rdc_loadpic.exe.asp

I can't seem to find an example for VB.Net and CR.Net

mlmcc
0
EwaldLCommented:
the only way would be to pass it to the subreport in a dataset, ie to a subreport which would only display one field and record, which would be the image.
0
useless_eaterAuthor Commented:
I'm using ComponentOne Reports for .Net instead now.  Much easier.  Please close
0
NetminderCommented:
User resolved; points (500) refunded and question closed.

Netminder
EE Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
domlsCommented:
Actually, you CAN set the path to a bitmap file that will replace an existing picture when using Crystal Reports in VB.  Here's how:

Using VB in Visual Studio 2010 and Crystal Reports 13.0.2000.0;

1) Right click the Crystal Reports designer page and select "Insert-->Picture".
2) Browse and insert your "dummy" picture file (i.e. bitmap)
3) Right click "Parameter Fields" and click "New" to create a new parameter called "pBmpPath"
This is so you can pass a path into the parameter's value that will be used by the dummy picture.
4) Right click the picture that you've loaded into your designer, and select "Format Object"
5) Click the picture tab
6) Click the "X-2" button located next to where it says "Graphic Location"
7) Switch to "Basic Syntax" and then paste the following formula:
formula = {?pBmpPath}

8) Save the formula by exiting both screens.
9) Now, in your subroutine where you fire up your report, do the following:
        Report_22.SetParameterValue("pBmpPath", GetAppPath() & "\MyBitmap.bmp")

Note that my report's object is called Report_22.  Just rename this to the variable that you're using for your report object.  Also, I'm using a subroutine called GetAppPath() that gets the application's runtime directory.

Now, just run your report, and voila!  Your image should be the one used at runtime!

domls
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.