Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 667
  • Last Modified:

Changing OLEObjects using VBscript

Hi

I am using crystal reports 7, and I wish to change an OLEObject (bmp) at runtime using vbscript.

Can anyone give an example completing the above.

0
cornerkey
Asked:
cornerkey
1 Solution
 
SpykairCommented:
0
 
GJParkerCommented:
This link demonstrates how to do it in C++ with version 7

http://support.businessobjects.com/communityCS/FilesAndUpdates/scr_cpp_rdcevents.exe.asp

This linkshows how to do it with VB in version 8

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr8_vb_rdc_loadpic.exe.asp

HTH

Gary
0
 
cornerkeyAuthor Commented:
Thanks

But it is crystal 7 and more importantly VBscript that I need.

0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
GJParkerCommented:
Then I don't think this is possible as teh method relies upon using the Reports section_format event and I don't think you will have access to this via VBScript,

how are you viewing the reports ?

Gary

0
 
cornerkeyAuthor Commented:
Very simply

We are using the active control placed upon a form and using VB script to run the report.  Nothing fancy.

David
0
 
GJParkerCommented:
what kind of form ?
is this over the web or are you creating an application ?
what programming tool are using ?

The answer to your initial question is that it isn't possible to change and image using VBScript. If you really need to use VBScript then the only way to do thi sis to upgrade to CR XI which has this functionality built in.

Gary
0
 
cornerkeyAuthor Commented:
Hi Gary

It is an application, and we have developed a common module in VBscript which can call a multidude of different reports based upon parameters.  This one report requires an image based upon the file location of a field value.  If you know of another way to populate a OLD field based upon the value of another then that would be excellent.

for example we have an OLEobject on the report and a database field PIC which has the value C:\BMP\A00001.BMP when that record is read I want to load the bitmap A00001.BMP into the OLE object.

I hope this explains what we are trying to acheive.

Regards

David
0
 
mlmccCommented:
I don't believe CR7 supported that feature.  It was added in CR8.

mlmcc
0
 
GJParkerCommented:
The only way would be to add all the possible images onto the report on top of each other and suppress the images not required using a suppression formula for each image  i.e. A00001.bmp would be

{MyTable.ImagePath} <> "C:\BMP\A00001.BMP"

HTH

Gary



0
 
cornerkeyAuthor Commented:
Thanks Gary

Good idea, but not a workable solution as the bitmaps are generated just prior to the report being printed.

What I have done is to move away from VBscript and into delphi, this seems to have the options I need

Thanks for your very prompt help

David
0
 
GJParkerCommented:
I'll take your word for that, as I don't use Delphi.  :-)

Glad i could help

Gary
0
 
GJParkerCommented:
My coments lead cornerkey to use a development tool and method as I suggested at the beginning.

Gary
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now