• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2294
  • Last Modified:

Access 2007: How do you insert the contents of an Attachment field for a printed report?

Access 2007: How do you insert the contents of your attachments in a report for printing? I have a table with attachments that can be short word documents, excel worksheets, or visio drawings. On screen, I can view them but then it only displays the icon (or a paperclip :) when you print it.

Related question: I can use OLE objects instead of attachments. In that case, I would like to resize the OLE control on the report dynamically and display the object only if it is not Null. How do I dynamically change the size of the OLE control in the  report? A code snippet would be welcome.

BTW, the field is optional and not all rows have an object/attachment associated with them.

Thanks,
krishna
0
TruthHunter
Asked:
TruthHunter
1 Solution
 
leonstrykerCommented:
Instead of keeping the attachments (BLOBs) in your database, you should rather store their location only.

Leon
0
 
TruthHunterAuthor Commented:
I understand your solution, but it is a small database and there are a decent number of small blobs. I'd rather store it with the rest of the data in the database so that the report comes from the database and not other "external" data stored on the computer.

I may have made a useful positive step forward -- I created a subreport with only the ole object and made its property in the main report to grow and to shrink. So now the main report looks good, with null OLE objects not being displayed (because the subreport can shrink). However, when the BLOB is not null, all the sub reports are the same size, the one I set the OLE box in the subreport to.

I need to scale the OLE object in the subreport appropriately depending on the BLOB's actual size in its native application...
0
 
leonstrykerCommented:
>I'd rather store it with the rest of the data in the database so that the report comes from the database and not other "external" data stored on the computer.

The report will come from the database anyway and by storing BLOBs outside the database, you are decreasing the chances of it becoming corrupted.

Leon
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
TruthHunterAuthor Commented:
OK -- You are correct that the source document does stay on the hard disk in either case.

However, we are migrating away from my actual question -- that of resizing the bounding box for an arbitrary (width, height, filetype) attachment or OLE object.

krishna
0
 
TruthHunterAuthor Commented:
OK, I think I found a solution that works for me -- May be it will be useful to someone else -- Use a subreport with nothing but the ole object on it, insert it into the main report and link the two reports using a common key. Next, make sure that this inserted subreport has border set to transparent (no border), and CanGrow and CanShrink are both set to Yes.

Now when you view the report, if OLE object on the subreport is Null, it will not be displayed (saving paper), and display the object in the box size defined in the subreport if it is.

While it is simple and works, the disadvantage is that the ole object size in the subreport is constant and your inserted objects get resized to that box. In my case, I have set the OLE box to 7"X5" that is large enough to hold tables, visio drawings, and images.

krishna
0
 
GRayLCommented:
What happens if the OLE object spills over onto two pages or more?
0
 
Ahmad Al RaeesiCommented:
I am using Access 2007 and I am using same method Krishna used last comment, I made report only for attachments and all my attachments are pictures and I scale the attachment to display in ful page so the problem is I can't print the second picture which is attach within same record.
0
 
Computer101Commented:
PAQed with points refunded (125)

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now