|
-
Feb 18th, 2003, 08:48 AM
#1
Thread Starter
Frenzied Member
Images in reports (Access)
Hi there.
Does someone know how to manipulate the reports in access.
I am trying to add a picture to the details section of a report.
This works for 50 %.
How can I supress the details section if no picture is available ??
This doesn't work if i set it in the details section ;
How can them picture sizes be manipulated during runtime ??
The first could be have the size of the third .
Someone know how to do this stuff ?
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 18th, 2003, 09:11 AM
#2
Lively Member
Working off memory here so please forgive me if I'm wrong but I assume your using the image control if so set the image mode to stretch rather than clip and it will automaticaly fit the size you have set the control to.
As for the hide the detail section I'm not sure if testing the image control source on opening the report and if it was null, set the detail visible property to false would work or not I guess you would have to try it and see.
HTH
JFK
-
Feb 18th, 2003, 09:27 AM
#3
Thread Starter
Frenzied Member
Not quite my question.
I'll rephrase.
The pictures are called at runtime so the stretch isn't working like it should.
The details section has more than these pictures to show.
If for some data a picture is not available i'd set the visible property for the image to false , but this doesn't surpress the sections height.
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 18th, 2003, 09:37 AM
#4
Lively Member
I understand better now I can't help you with the image problem I'm afraid but is the rest of the data a fixed height so that if an image isn't available then you can set the detail height property to a known value?
If not I can't remember if the reports have a can grow and can shrink property as forms do ,if you set both of these to yes then the section will fit itself to the contents.
HTH
JFK
-
Feb 18th, 2003, 10:03 AM
#5
Thread Starter
Frenzied Member
The height cannot be set in the print event, if i place it in the format event nothing happens. section stays same .
If i set the visible property to false it is set for each record.
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 18th, 2003, 04:01 PM
#6
Hyperactive Member
Try using a third label with a function attached to it that activates on every record. if the picture is empty size it to 0.
-
Feb 19th, 2003, 04:02 AM
#7
Thread Starter
Frenzied Member
I've managed to set the height in the detail format section.
Does someone know how i can get the width and height of them images , these are not available in a DB but are stored on the machine local or not.
I would like to set the sizes to these images at runtime.
This to not waste space or shrink images in a smaller size.
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 19th, 2003, 06:08 AM
#8
Thread Starter
Frenzied Member
No one knows how to get the sizes of images on machine.
They can be in any format, bmp, jpg, ...
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 19th, 2003, 04:46 PM
#9
Let me see if I remember how to do this.
First you need a image control in the report section. Next in the code for the format of the detail section of the report you need to add a check to see if there's an image to load. If no image then set the visible property for the report section that has the image control to false.
Second, once you know that you have an image you need to set the properties from code, not on the image control. The control is just the conduit to display the image. This means that you can set the strech property and any pther value fopr the image control in code on the format section of the detail section of the report. This will work for any type of image of any size.
Let me know if this helps, if not then send me an example of your report and I can work out a method that will do what you need. I have done this before several ways.
-
Feb 20th, 2003, 03:08 AM
#10
Thread Starter
Frenzied Member
This is what i got till now
VB Code:
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
'ive got foto control which holds the link to the image
Me![foto].Properties("Height") = 0
Me![img].Picture = ""
Me![img].Visible = False
If IsNull([foto]) Then
Me![img].Properties("Height") = 0
'if the foto property is empty i set the heights of the image and section to 0
Me.Detail1.Height = 0
Else
' else i set a default height for the image cause i don't know
'the sizes of these images
Me![img].Properties("Height") = 1255
Me![img].Picture = Mid([foto], 2, Len([foto]) - 2)
Me![img].Visible = True
Me![img].Properties("SizeMode") = 0
End If
End Sub
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 20th, 2003, 03:16 AM
#11
Lively Member
Swatty how about
Me![img].sizetofit = true
JFK
-
Feb 20th, 2003, 03:44 AM
#12
Thread Starter
Frenzied Member
Thanks man how about
VB Code:
err.description
You entered an expression that has an invalid reference to the property SizeToFit.
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Feb 20th, 2003, 04:06 PM
#13
Let me see what I come up with. I know that I have done this before. May take a few days for me to find it or write it.
-
Feb 24th, 2003, 05:36 PM
#14
Answer
Sorry took so long, had to start from the begining. Let me know if this wirks for you. Be sure to use images that you have on your pc and not the ones that I have referenced in the table.
-
Feb 24th, 2003, 05:42 PM
#15
Did not realize that the file is too large to upload so we will need to work it out another way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|