Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: About adjust OLE object in Report Custom Functions Post Reply Post New Topic
Author Message
andrewhuang
Newbie
Newbie


Joined: 17 Jun 2012
Location: Canada
Online Status: Offline
Posts: 8
Quote andrewhuang Replybullet Topic: About adjust OLE object in Report Custom Functions
    Posted: 17 Jun 2012 at 11:32am
Hi,

There is an OLE object - picture in my report, how can I access/change the picture's properties, such as Width.
Using Basic Syntax:

Dim thePicture As Object
Set thePicture = LoadPicture("c:\temp\myPicture.bmp")
Set Picture1.FormattedPicture = thePicture
Picture1.Width = thePicture.Width
Picture1.Height = thePicture.Height

It doesn't work:
1. Object is not data type
2. LoadPicture can be found
3. Picture1 is a field of OLE object in my report

My question:
1. how to load a picture
2. how to change the ole object's properties

Thanks,
Andrew
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jun 2012 at 4:17am

Which version of Crystal are you using?  In XI (I believe) and above (I know this is in 2008 and 2011) you would do the following:

 
1.  Right-click on the image object and select "Format Graphic"
2.  Go to the Picture tab.
3.  Click on the button by "Graphic Location"
4.  Select the field that contains the location of the image.
5.  Make sure that Scaling is set to 100%.
6.  Go to the General tab and turn on "Can Grow"
7.  Click on OK.
 
-Dell
IP IP Logged
andrewhuang
Newbie
Newbie


Joined: 17 Jun 2012
Location: Canada
Online Status: Offline
Posts: 8
Quote andrewhuang Replybullet Posted: 18 Jun 2012 at 6:37pm
Originally posted by hilfy

Which version of Crystal are you using?  In XI (I believe) and above (I know this is in 2008 and 2011) you would do the following:

 
1.  Right-click on the image object and select "Format Graphic"
2.  Go to the Picture tab.
3.  Click on the button by "Graphic Location"
4.  Select the field that contains the location of the image.
5.  Make sure that Scaling is set to 100%.
6.  Go to the General tab and turn on "Can Grow"
7.  Click on OK.
 
-Dell

Thanks, Dell.
My Crystal Report is 2008. Maybe I didn't make my question clearly. I mean, how to use VB in Formula Editor? Such as, change the picture's width. For example, my picture just in Details, the Object Name is Picture1. But I can't use Picture1.Width=10 to change its width.

Thanks,
-Andrew
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 19 Jun 2012 at 3:09am

Simple answer - you can't.

 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.