changing a data report image control's source in code

changing a data report image control's source in code

Post by William F. LaMarti » Fri, 10 Dec 1999 04:00:00


I would like to set the image source for an image in a data report at
runtime with code something like:

DataReport1.Sections("section1").Controls("image1").Picture =
LoadPicture(strPicture_file)

This, however, produces an error.  I can use similar code to set the font
for a text box on the report.

Is the image source for  RptImage on a data report restricted to being set
at design-time only? Or do I have incorrect code?

 
 
 

changing a data report image control's source in code

Post by Eric Petroelj » Fri, 10 Dec 1999 04:00:00


Since the Picture property is probably an object, you have to use Set.
Set DataReport1.Sections("section1").Controls("image1").Picture =
LoadPicture(strPicture_file)



Quote:> I would like to set the image source for an image in a data report at
> runtime with code something like:

> DataReport1.Sections("section1").Controls("image1").Picture =
> LoadPicture(strPicture_file)

> This, however, produces an error.  I can use similar code to set the font
> for a text box on the report.

> Is the image source for  RptImage on a data report restricted to being set
> at design-time only? Or do I have incorrect code?


 
 
 

changing a data report image control's source in code

Post by William F. LaMarti » Sat, 11 Dec 1999 04:00:00


Thanks very much.  That solved the problem. I have never been sure of when
to use Set


> Since the Picture property is probably an object, you have to use Set.
> Set DataReport1.Sections("section1").Controls("image1").Picture =
> LoadPicture(strPicture_file)



> > I would like to set the image source for an image in a data report at
> > runtime with code something like:

> > DataReport1.Sections("section1").Controls("image1").Picture =
> > LoadPicture(strPicture_file)

> > This, however, produces an error.  I can use similar code to set the
font
> > for a text box on the report.

 
 
 

1. Data Report can't execute normally after source code compiled

I have write a vb program which has a data report and data
environment.
I used the data environment to pass the data to the data report.
When in the design mode. I have opne the data report form normally.
But after I complie the source code and move the executed program to
another pc which doesn't intalled visual basic. the data report can't
open and the program exit. I alread copy the the following files to
the system system folder and the common files folder, please help.
the files I copy:
COMCT332.OCX
MSADODC.OCX
MSBIND.DLL
MSCHRT20.OCX
Mscomct2.ocx
Mscomctl.ocx
MSDATREP.OCX
msdatsrc.tlb
MSDBRPTR.DLL
MSDERUN.DLL
MSHFLXGD.OCX
MSSTDFMT.DLL
msvbvm60.dll

2. DB-lib/Sybperl Error handler question

3. Source code/Change Control package for Sotred Proceedures ??

4. insufficent memory for Index Tuning Wizard

5. Source code control of SP's

6. Very Simple SQL problem (but beyond my capabilities!)

7. Create User Control as Data Source Using ADO Data Control

8. Auto Increment Field -How to obtain value after Insert

9. Help:ODBC Data Source Admin doesn't show Names of new Data Sources

10. Printing Rich Textbox Active X Control source data in a VFP5.0 report

11. changing data source in crystal report @ runtime

12. Source code for VB's Data Form Wizard

13. How to change Data Source of a form and report