Solved

Passing Images to a Crystal report from VB.Net

Posted on 2003-11-28
6
4,391 Views
Last Modified: 2012-04-25
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.
0
Comment
Question by:useless_eater
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 9839537
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
 
LVL 13

Expert Comment

by:EwaldL
ID: 9840649
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
 

Author Comment

by:useless_eater
ID: 10130240
I'm using ComponentOne Reports for .Net instead now.  Much easier.  Please close
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 10144533
User resolved; points (500) refunded and question closed.

Netminder
EE Admin
0
 

Expert Comment

by:domls
ID: 37891456
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now