Results 1 to 5 of 5

Thread: [RESOLVED] How to dynamically load pictures in datareport Using VB Coding?

  1. #1

    Thread Starter
    Addicted Member senthilkumartd's Avatar
    Join Date
    Feb 2005
    Posts
    206

    Resolved [RESOLVED] How to dynamically load pictures in datareport Using VB Coding?

    Hi,
    How to dynamically load pictures in datareport Using VB Coding?. I wish to have the picture in the data report say as a logo. I wish to print the logo based on the input given. But, the following is not exectuted:
    VB Code:
    1. drsalbl.Sections(2).Controls("img").Picture = loadpicture(App.Path + "\LH1.jpg")
    Because the Image control on datareport does not support to change the picture on run time.

    Is any thing mistake in my approach? or
    Is there any other way to accomplish the above thing?

    Please help me.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: How to dynamically load pictures in datareport Using VB Coding?

    You are very close - Picture property is an Object so it has to be Set.
    Also, try not to use indexes but rather names when accessing Sections/Controls/etc...
    VB Code:
    1. Private Sub DataReport_Initialize()
    2.     Set Me.Sections("SectionHeader").Controls("Image1").Picture = LoadPicture(App.Path & "\LH1.jpg")
    3. End Sub

  3. #3

  4. #4

    Thread Starter
    Addicted Member senthilkumartd's Avatar
    Join Date
    Feb 2005
    Posts
    206

    Re: How to dynamically load pictures in datareport Using VB Coding?

    thanks

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width