cancel
Showing results for 
Search instead for 
Did you mean: 

Load Image from hard drive dynamically

Former Member
0 Kudos

Hi,

I have a requirement to load image from hard drive dynamically based on some conditions. I have googled it and found that we can use RAS. I am using Crystal Reports plugin that comes with RAD 7.0 and I am not sure if this supports RAS. I get Connection Refused to localhost exception. I have used the following code. Any help on this is appreciated.

//Create a new Report Application Session

ReportAppSession reportAppSession = new ReportAppSession();

//Create a Report Application Server Service

reportAppSession.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");

//Set the RAS Server to be used for the service. You can also use "localhost" if the RAS server is running on your local machine.

reportAppSession.setReportAppServer("localhost");

//Initialize RAS

reportAppSession.initialize();

cheers,

Ram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you can show this post [|]

Answers (1)

Answers (1)

0 Kudos

Not clear but RAD is Java so I moved your post to the Java SDK forum.

Include the current version of CR you are using and what you have tried? First thing to do is make it work in Crystal Reports Designer or if you are attempting to add an image at runtime it is possible using RAS in both Java and .NET.

Need the version first to say if that version has the ability though, it was something added to current versions.

Don

Former Member
0 Kudos

Hi Don,

Thanks for the quick response. I am using

Crystal Reports for Rational Application Developer

Version: 11.5.2.v20070215

I am trying to add an image at the runtime as the image file name might change based on certain business conditions.

cheers,

Ram

Former Member
0 Kudos

Don,

I need add one more point here. When I tried adding the image in the Crystal reports Designer it is mapped to that image itself which I have added. There is no way that I could change any path of the file. i have also noticed that at runtime it is creating a .png file and loading it. My original image is .gif file. Hence I left that option and started looking to add dynamically. Any other thoughts / suggesstions on this is appreciated.

Thanks,

Ram

Adam_Stone
Active Contributor
0 Kudos

In the XIR2 designer, for images there is a setting that you can use to specify a location to load the image from. You have the option to create a formula for it. I've seen people use database fields that contain the path on disk to load the image, or even use a parameter to say where to find the image. Otherwise, I would suggest looking at our samples as I believe there is a sample on how to add an image to a report using RAS.