Images on Report

N

nhdee

Using Accesss 2007. I have a table that includes attachment type called
SPics. On the form I can choose the picture(s) I want, with control source =
SPics, it works fine. If there is a picture it displays fine on the report
as well. On the report I put SPics. What I want to happen is: IF there is
no picture I don't want it to take up the report space. What I have below
is not working and I don't know VB that well so can anyone tell me what I
should have in the Format Event to make this work?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If NotIsNull(Me.SPics) Then
Me.SPics.Visible = True
Else
Me.SPics.Visible = False
SPicsCtrl.Width = 0
SPicsCtrl.Height = 0
Me.Detail.Height = 0
End If

End Sub

-- Thanks!
-nhdee-
 
D

Duane Hookom

I SPics is the only significant control in the detail section then just
Cancel the formatting. Something like this might work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = IsNull(Me.SPics)
End Sub
 
N

nhdee

It isn't the only control. There are several pictures. If there is a
picture it works fine but when thre isn't I don't want the report to show the
placeholder for the picture (3x2.5). I tried your suggestion and it still
displays the place holder for SPics, taking up room on the report. Do you
need more info?
 
D

Duane Hookom

Maybe you can provide more information about the layout of you report
section. Is the picture at the bottom by itself?
 
N

nhdee

Hi Duane,

Thanks for your help, I really appreciate it. I would love to be able to
get this report the way I want with the pictures. 2007 makes it easier but I
just can't get quite what I want....

I'll back up a bit with my explanation to hopefully give you a better
understanding... In a table I have a field called SPics (there is also
TPics, BTPics and others) that are data type attachments.

Those fields are on a form (SPics...as the control source). The user can
insert the picture from their hard drive from the Attachments dialog box that
appears. The result is stored in SPics (...).

The report is based on a query. As I said the report will display a photo
if there is one. If there is more than one photo it only shows the arrow key
to "display" the others. So I would like to be able to print all of them if
there is more than one and remove the blank space from the report if there is
none.

The report works fine if there is a picture - I have the field SPics (and
all the other fields from my query that are needed) on the report.

Properties:
RecordSource: qBathroom Results
GrpKeepTogether: Per Column
Picture: (none) PictureAlignment: Center
PicturePages: All Pages PictureSizeMode: Zoom
PictureTiling: False PictureType: 0

Section: Detail
CanGrow: True
CanShrink: True DisplayWhen: Alway

SPics [This is the attachment]
BackColor: 16777215 BackStyle: Transparent
BorderColor: 12632256 BorderLineStyle: Transparent
BorderStyle: Transparent BorderWidth: Hairline
BottomPadding: 30 ControlSource: SPics
ControlType: 126 DefaultPicture: (none)
DisplayAs: 0 DisplayWhen: Always
Enabled: True EventProcPrefix: SPics
GridlineColor: 0 GridlineStyleBottom Transparent
:
GridlineStyleLeft: Transparent GridlineStyleRight: Transparent
GridlineStyleTop: Transparent GridlineWidthBottom: 1
GridlineWidthLeft: 1 GridlineWidthRight: 1
GridlineWidthTop: 1 Height: 3600
HelpContextId: 0 ImageData: Long binary data
Layout: 0 LayoutID: 0
Left: 4575 LeftPadding: 30
Name: SPics OldBorderStyle: 0
PictureAlignment: Center PictureSizeMode: Zoom
PictureTiling: False RightPadding: 30
Section: 0 SpecialEffect: Flat
TabIndex: 35 TabStop: True
TextAlign: General Top: 7440
TopPadding: 30 Visible: True
Width: 4320


Not sure what else I should give you - these are just snippets from the
report documenter.

I want the picture (if there is one) to be after the detail information (but
in the detail section of the report) about the bathroom (like SPics is the
bathroom sink so I have the placeholder (SPics field) on the report where I
want it - after the information (Condition; Comments...) on the sink. If
there isn't a picture don't have it take up the space.
 
D

Duane Hookom

I still don't think you provided any information about what might be around
the picture. Particularly anything in the detail section to the left or
right or below the picture.

--
Duane Hookom
MS Access MVP


nhdee said:
Hi Duane,

Thanks for your help, I really appreciate it. I would love to be able to
get this report the way I want with the pictures. 2007 makes it easier
but I
just can't get quite what I want....

I'll back up a bit with my explanation to hopefully give you a better
understanding... In a table I have a field called SPics (there is also
TPics, BTPics and others) that are data type attachments.

Those fields are on a form (SPics...as the control source). The user can
insert the picture from their hard drive from the Attachments dialog box
that
appears. The result is stored in SPics (...).

The report is based on a query. As I said the report will display a photo
if there is one. If there is more than one photo it only shows the arrow
key
to "display" the others. So I would like to be able to print all of them
if
there is more than one and remove the blank space from the report if there
is
none.

The report works fine if there is a picture - I have the field SPics (and
all the other fields from my query that are needed) on the report.

Properties:
RecordSource: qBathroom Results
GrpKeepTogether: Per Column
Picture: (none) PictureAlignment: Center
PicturePages: All Pages PictureSizeMode: Zoom
PictureTiling: False PictureType: 0

Section: Detail
CanGrow: True
CanShrink: True DisplayWhen: Alway

SPics [This is the attachment]
BackColor: 16777215 BackStyle: Transparent
BorderColor: 12632256 BorderLineStyle: Transparent
BorderStyle: Transparent BorderWidth: Hairline
BottomPadding: 30 ControlSource: SPics
ControlType: 126 DefaultPicture: (none)
DisplayAs: 0 DisplayWhen: Always
Enabled: True EventProcPrefix: SPics
GridlineColor: 0 GridlineStyleBottom Transparent
:
GridlineStyleLeft: Transparent GridlineStyleRight: Transparent
GridlineStyleTop: Transparent GridlineWidthBottom: 1
GridlineWidthLeft: 1 GridlineWidthRight: 1
GridlineWidthTop: 1 Height: 3600
HelpContextId: 0 ImageData: Long binary data
Layout: 0 LayoutID: 0
Left: 4575 LeftPadding: 30
Name: SPics OldBorderStyle: 0
PictureAlignment: Center PictureSizeMode: Zoom
PictureTiling: False RightPadding: 30
Section: 0 SpecialEffect: Flat
TabIndex: 35 TabStop: True
TextAlign: General Top: 7440
TopPadding: 30 Visible: True
Width: 4320


Not sure what else I should give you - these are just snippets from the
report documenter.

I want the picture (if there is one) to be after the detail information
(but
in the detail section of the report) about the bathroom (like SPics is the
bathroom sink so I have the placeholder (SPics field) on the report where
I
want it - after the information (Condition; Comments...) on the sink. If
there isn't a picture don't have it take up the space.

--
-nhdee-


Duane Hookom said:
Maybe you can provide more information about the layout of you report
section. Is the picture at the bottom by itself?
 
N

nhdee

There are fields above and below the picture(s), answers to what condition
the bathroom is in, possibly materials and comments about each area
inspected. Can I export the report to you? What is the best way for me to
give you the correct information and / or could you be more specific as to
what I should be providing to make a diffrence as to the image printing or
not. Thanks!
--
-nhdee-


Duane Hookom said:
I still don't think you provided any information about what might be around
the picture. Particularly anything in the detail section to the left or
right or below the picture.

--
Duane Hookom
MS Access MVP


nhdee said:
Hi Duane,

Thanks for your help, I really appreciate it. I would love to be able to
get this report the way I want with the pictures. 2007 makes it easier
but I
just can't get quite what I want....

I'll back up a bit with my explanation to hopefully give you a better
understanding... In a table I have a field called SPics (there is also
TPics, BTPics and others) that are data type attachments.

Those fields are on a form (SPics...as the control source). The user can
insert the picture from their hard drive from the Attachments dialog box
that
appears. The result is stored in SPics (...).

The report is based on a query. As I said the report will display a photo
if there is one. If there is more than one photo it only shows the arrow
key
to "display" the others. So I would like to be able to print all of them
if
there is more than one and remove the blank space from the report if there
is
none.

The report works fine if there is a picture - I have the field SPics (and
all the other fields from my query that are needed) on the report.

Properties:
RecordSource: qBathroom Results
GrpKeepTogether: Per Column
Picture: (none) PictureAlignment: Center
PicturePages: All Pages PictureSizeMode: Zoom
PictureTiling: False PictureType: 0

Section: Detail
CanGrow: True
CanShrink: True DisplayWhen: Alway

SPics [This is the attachment]
BackColor: 16777215 BackStyle: Transparent
BorderColor: 12632256 BorderLineStyle: Transparent
BorderStyle: Transparent BorderWidth: Hairline
BottomPadding: 30 ControlSource: SPics
ControlType: 126 DefaultPicture: (none)
DisplayAs: 0 DisplayWhen: Always
Enabled: True EventProcPrefix: SPics
GridlineColor: 0 GridlineStyleBottom Transparent
:
GridlineStyleLeft: Transparent GridlineStyleRight: Transparent
GridlineStyleTop: Transparent GridlineWidthBottom: 1
GridlineWidthLeft: 1 GridlineWidthRight: 1
GridlineWidthTop: 1 Height: 3600
HelpContextId: 0 ImageData: Long binary data
Layout: 0 LayoutID: 0
Left: 4575 LeftPadding: 30
Name: SPics OldBorderStyle: 0
PictureAlignment: Center PictureSizeMode: Zoom
PictureTiling: False RightPadding: 30
Section: 0 SpecialEffect: Flat
TabIndex: 35 TabStop: True
TextAlign: General Top: 7440
TopPadding: 30 Visible: True
Width: 4320


Not sure what else I should give you - these are just snippets from the
report documenter.

I want the picture (if there is one) to be after the detail information
(but
in the detail section of the report) about the bathroom (like SPics is the
bathroom sink so I have the placeholder (SPics field) on the report where
I
want it - after the information (Condition; Comments...) on the sink. If
there isn't a picture don't have it take up the space.

--
-nhdee-


Duane Hookom said:
Maybe you can provide more information about the layout of you report
section. Is the picture at the bottom by itself?

--
Duane Hookom
MS Access MVP


It isn't the only control. There are several pictures. If there is a
picture it works fine but when thre isn't I don't want the report to
show
the
placeholder for the picture (3x2.5). I tried your suggestion and it
still
displays the place holder for SPics, taking up room on the report. Do
you
need more info?
--
-nhdee-


:

I SPics is the only significant control in the detail section then
just
Cancel the formatting. Something like this might work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = IsNull(Me.SPics)
End Sub

--
Duane Hookom
MS Access MVP


Using Accesss 2007. I have a table that includes attachment type
called
SPics. On the form I can choose the picture(s) I want, with control
source =
SPics, it works fine. If there is a picture it displays fine on the
report
as well. On the report I put SPics. What I want to happen is: IF
there
is
no picture I don't want it to take up the report space. What I
have
below
is not working and I don't know VB that well so can anyone tell me
what
I
should have in the Format Event to make this work?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If NotIsNull(Me.SPics) Then
Me.SPics.Visible = True
Else
Me.SPics.Visible = False
SPicsCtrl.Width = 0
SPicsCtrl.Height = 0
Me.Detail.Height = 0
End If

End Sub

-- Thanks!
-nhdee-
 
D

Duane Hookom

If there are controls above and below the image, I would create multiple
detail sections. You can do this by adding a lowest level sorting and
grouping level on the primary key value in the report's record source.

Display the Group Header and Footer sections for this new group. You can now
put controls across the group header, detail, and group footer sections.
Place only the image in the detail section and use code to cancel its
formatting if Me.Spics is null.

--
Duane Hookom
Microsoft Access MVP


nhdee said:
There are fields above and below the picture(s), answers to what condition
the bathroom is in, possibly materials and comments about each area
inspected. Can I export the report to you? What is the best way for me to
give you the correct information and / or could you be more specific as to
what I should be providing to make a diffrence as to the image printing or
not. Thanks!
--
-nhdee-


Duane Hookom said:
I still don't think you provided any information about what might be around
the picture. Particularly anything in the detail section to the left or
right or below the picture.

--
Duane Hookom
MS Access MVP


nhdee said:
Hi Duane,

Thanks for your help, I really appreciate it. I would love to be able to
get this report the way I want with the pictures. 2007 makes it easier
but I
just can't get quite what I want....

I'll back up a bit with my explanation to hopefully give you a better
understanding... In a table I have a field called SPics (there is also
TPics, BTPics and others) that are data type attachments.

Those fields are on a form (SPics...as the control source). The user can
insert the picture from their hard drive from the Attachments dialog box
that
appears. The result is stored in SPics (...).

The report is based on a query. As I said the report will display a photo
if there is one. If there is more than one photo it only shows the arrow
key
to "display" the others. So I would like to be able to print all of them
if
there is more than one and remove the blank space from the report if there
is
none.

The report works fine if there is a picture - I have the field SPics (and
all the other fields from my query that are needed) on the report.

Properties:
RecordSource: qBathroom Results
GrpKeepTogether: Per Column
Picture: (none) PictureAlignment: Center
PicturePages: All Pages PictureSizeMode: Zoom
PictureTiling: False PictureType: 0

Section: Detail
CanGrow: True
CanShrink: True DisplayWhen: Alway

SPics [This is the attachment]
BackColor: 16777215 BackStyle: Transparent
BorderColor: 12632256 BorderLineStyle: Transparent
BorderStyle: Transparent BorderWidth: Hairline
BottomPadding: 30 ControlSource: SPics
ControlType: 126 DefaultPicture: (none)
DisplayAs: 0 DisplayWhen: Always
Enabled: True EventProcPrefix: SPics
GridlineColor: 0 GridlineStyleBottom Transparent
:
GridlineStyleLeft: Transparent GridlineStyleRight: Transparent
GridlineStyleTop: Transparent GridlineWidthBottom: 1
GridlineWidthLeft: 1 GridlineWidthRight: 1
GridlineWidthTop: 1 Height: 3600
HelpContextId: 0 ImageData: Long binary data
Layout: 0 LayoutID: 0
Left: 4575 LeftPadding: 30
Name: SPics OldBorderStyle: 0
PictureAlignment: Center PictureSizeMode: Zoom
PictureTiling: False RightPadding: 30
Section: 0 SpecialEffect: Flat
TabIndex: 35 TabStop: True
TextAlign: General Top: 7440
TopPadding: 30 Visible: True
Width: 4320


Not sure what else I should give you - these are just snippets from the
report documenter.

I want the picture (if there is one) to be after the detail information
(but
in the detail section of the report) about the bathroom (like SPics is the
bathroom sink so I have the placeholder (SPics field) on the report where
I
want it - after the information (Condition; Comments...) on the sink. If
there isn't a picture don't have it take up the space.

--
-nhdee-


:

Maybe you can provide more information about the layout of you report
section. Is the picture at the bottom by itself?

--
Duane Hookom
MS Access MVP


It isn't the only control. There are several pictures. If there is a
picture it works fine but when thre isn't I don't want the report to
show
the
placeholder for the picture (3x2.5). I tried your suggestion and it
still
displays the place holder for SPics, taking up room on the report. Do
you
need more info?
--
-nhdee-


:

I SPics is the only significant control in the detail section then
just
Cancel the formatting. Something like this might work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = IsNull(Me.SPics)
End Sub

--
Duane Hookom
MS Access MVP


Using Accesss 2007. I have a table that includes attachment type
called
SPics. On the form I can choose the picture(s) I want, with control
source =
SPics, it works fine. If there is a picture it displays fine on the
report
as well. On the report I put SPics. What I want to happen is: IF
there
is
no picture I don't want it to take up the report space. What I
have
below
is not working and I don't know VB that well so can anyone tell me
what
I
should have in the Format Event to make this work?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If NotIsNull(Me.SPics) Then
Me.SPics.Visible = True
Else
Me.SPics.Visible = False
SPicsCtrl.Width = 0
SPicsCtrl.Height = 0
Me.Detail.Height = 0
End If

End Sub

-- Thanks!
-nhdee-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top