如何在MS Access报告中显示BLOB图像? [英] How to display BLOB images in a MS Access Report?

查看:67
本文介绍了如何在MS Access报告中显示BLOB图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试创建一个报告,显示每条记录的所有相关信息。但是,这包括显示每条记录的屏幕截图。

图像上传并存储为BLOBS。我已经使用过这种方法,因为许多讨论认为它是最好的选择,因为其他方法存在膨胀和路径问题。然而,我自己编写的代码有点超出我的知识,所以我不得不使用互联网上的一些并相应地改变它。


关于上传文件的一切到数据库工作,但我现在的问题是要在报告中显示文件。我已经尝试过使用从对象框架到activeX图像控件的所有东西,但我担心我不知道我在这里做了什么来正确使用它们。任何人都可以提供有关如何在报告中显示BLOB图像的任何帮助吗?


谢谢。


Adam。

Hi all,

I''m trying to create a report that displays all relevant information per record. However this includes displaying a screenshot for each record.
Images are uploaded and stored as BLOBS. I''ve used this method as many discussions say it is the best option, due to bloating and path issues with the other methods. However to write the code for this myself is a little outside my knowledge, so I''ve had to use some found on the internet and alter it accordingly.

Everything regarding uploading the file to the database is working, but my problem now is getting to files to display in a report. I''ve tried using everything from object frames to activeX image controls, but I fear I do not know enough about what I''m doing here to make use of them correctly. Can anyone please offer any help on how to display BLOB images in reports?

Thanks.

Adam.

推荐答案

@Adam - 我要提出的是严格的理论,我完全不知道它是否有效。由于BLOB数据以二进制格式存储,因此无法以我所知的任何方式直接在报表上显示。这就是我的建议:
@Adam - What I am about to propose is strictly Theory on my part, and I have absolutely no idea as to whether or not it will work. Since the BLOB Data is stored in a Binary Format, it cannot be displayed directly on a Report in any manner that I know of. This is what I am proposing:
  1. 从OLE对象字段中提取包含BLOB的二进制数据,并将其写入ADO流对象。
  2. 将流对象(BLOB)的内容保存到Temp文件中,并将主键作为唯一标识符。
  3. 将Temp文件加载到记录中每个记录的图像控件的图片属性中报告来源。这可以在报告的详细信息部分中完成。
  4. 在尝试此方法之前,您必须知道与每个BLOB关联的文件扩展名(.bmp,.jpg等)。
  5. 如果您确实知道每个BLOB的扩展,那么我很乐意为您测试这个理论,请告诉我。


希望它能够处理尽可能多的文件扩展名,至少是所有主要的图像扩展名。根据你的说法,我是否假设每个都需要不同的编码?


此外,这种方法是否允许根据查询自动生成报告,多个图像?

我想要创建的内容就像一个View-All报告显示一个报告中的每条记录,但每个报告至少包含一个图像,可能更多。这些记录也可能会有变化,所以不能有任何硬编码的文件路径。


我现在问的唯一理由是这种方法看起来有点过头了,显然需要一些时间要做,所以我想知道它是否值得。 (当然所有知识都值得学习,但我现在需要具体了:))


目前数据库中唯一的扩展名是.jpg文件,就像那样我先得到了什么。


干杯。


亚当。
Well the hope was that it would handle as many file extensions as possible, at least all the major image extensions. From what you''ve said, do I assume different coding is required for each?

Also, would this method allow for a report to be auto-generated based on a query, with multiple images?
What I''m trying to create is like a "View-All" report that shows every record in one report, but each report includes at least one image, possibly more. Also these records are subject to change, so cannot have any hardcoded file paths.

Only reason I ask now is this methods looks a little over my head, and will clearly take me some time to do, so I want to know if it''s worth it. (Of course all knowledge is worth learning, but I need to be specific at the moment :) )

The only extensions currently in the database are .jpg files, as that''s what I got hold of first.

Cheers.

Adam.


给我一点是时候看看我是否可以拿出任何东西,因为这是我以前从未想过的一个领域。我会在这件事上回复你。
Give me a little time to see if I can come up with anything since this is an area that I never ventured into before. I''ll get back to you on this matter.


这篇关于如何在MS Access报告中显示BLOB图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆