| Subject |
Re: images in a report |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Fri, 2 Jul 2021 10:07:07 +0200 |
| Newsgroups |
dbase.getting-started |
On 2021/07/02 04:18, roy price wrote:
> Hello again,
> Well I followed the advice regarding images, when creating a form, to
> just include a field with directory and filename on a table, instead of
> the image itself.
> That works well.
>
> I am now trying to find out how to include the same image from a
> directory on a report, as I cannot see any examples to follow, that
> might give me a clue as how to do it.
>
> (I have a report printout I created 20 years ago that has an image on
> it, but I can't now say if the image was from a table field or from a
> directory)
If the image itself is stored in the table the field will appear in the
report designer's Field Palette as an image. Simply drag the field on
to the report and adjust its size.
With the filename, including its path, saved in a field it's a little
bit more complicated.
Drag an image control from the Component Palette on to the form. Size
the control to suit. If the control loses focus it will seem to
disappear but if you click where it is suppose to be you will see it's
outline.
In the Inspector select the image control's canRender event and click
the Spanner button. This will create a skeleton event handler in the
sourcecode editor. Place the following code in the event handler.
function IMAGE1_canRender()
this.dataSource = "FILENAME
"+form.your_query_name.rowset.fields['your_fieldname'].value
return true
As easy as that. :-)
Mervyn.
|
|