Solved

Passing Images to a Crystal report from VB.Net

Posted on 2003-11-28
6
4,591 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 101

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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