?
Solved

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

Posted on 2007-07-26
9
Medium Priority
?
2,290 Views
Last Modified: 2013-12-20
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
Comment
Question by:TruthHunter
8 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 19576352
Instead of keeping the attachments (BLOBs) in your database, you should rather store their location only.

Leon
0
 

Author Comment

by:TruthHunter
ID: 19576871
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
 
LVL 29

Expert Comment

by:leonstryker
ID: 19576896
>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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:TruthHunter
ID: 19577471
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
 

Author Comment

by:TruthHunter
ID: 19577804
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
 
LVL 44

Expert Comment

by:GRayL
ID: 19578012
What happens if the OLE object spills over onto two pages or more?
0
 

Expert Comment

by:Ahmad Al Raeesi
ID: 19697875
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21147173
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question