Crystal Reports 图像在运行时加载
我有一些有很多记录的报告。这些记录有图像。它们来自 .NET Dataset 对象。 我最初采用的是使用 System.Byte[] 列将图像内容放入记录中的方法,但报告占用了太多时间来加载。
我做了时间分析。并不是数据集构建花费太多。 我提出了图像正在减慢这一过程的假设。
所以我尝试了一种不同的方法:我没有将图片直接放入表格中,而是使用文件路径。 按照《水晶报表用户指南》中描述的实践,我插入了一个“画笔图片类型”的 OLE 对象,并将其图像的图形位置设置为数据库表字段。此外,我还将文件超链接定义为同一字段。
我试过了,没有显示图像。但点击超链接就可以了。
因此,我在报告中添加了两个 OLE 对象项进行测试:第一个的图形位置和超链接具有第一个记录的图像的文件路径。它是一个 .jpg 文件。
我另外创建了该图像的 .bmp 副本,并将第二个项目的文件路径设置为指向该图像。
再次测试,超链接工作正常,但报告中没有直接显示图像。
当我在 Visual Studio 2010 Crystal Reports 设计器上单击“预览”时,我可以看到图像,但在运行时看不到图像。
那么,我缺少什么图像来显示?
附加信息: VS 2010 premium
.Net Framework 4
Windows 7 64 位
Crystal reports 集成在 Visual Studio 上
提前致谢, 塞尔吉奥
I have some reports with many records. Those records have images. They were coming from a .NET Dataset object.
I was initially making the approach of getting the images' contents into the records using System.Byte[] Columns, but the reports took up too much time to load.
I did time profiling. It is not the dataset construction that takes too much.
I put on the table the hypothesis of the images being slowing the process.
So I tried a different approach: Instead of having pictures directly into the tables, I have filepaths.
Following the practic described in Crystal Reports User Guide, I inserted a OLE object of "Paintbrush Picture Type" and its Image's Graphic Location was ser to a database table field. Additionally I also defined a file hyperlink to be the same field.
I tried, it didn' t show the image. But clicking the hyperlink was OK.
So I added more two OLE object items in the report for testing: the first's Graphic location and hyperlink have the filepath of the first record's image. It is a .jpg file.
I created additionally a .bmp copy of that image and set the second item's filepaths to point to this image.
Tested again, hyperlinks work Ok, but no images shown directly in report .
When I click Preview on Visual Studio 2010 Crystal Reports designer I can see the images, but not in runtime.
So, what am I missing for the images to show?
additional info:
VS 2010 premium
.Net framework 4
Windows 7 64 bits
Crystal reports is integrated on Visual Studio
Thanks in advance,
Sérgio
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一段令人沮丧的时间后,我似乎通过 3 个简单的步骤找到了解决方案:
如果您使用 CR 作为组件,在运行时您会注意到组件的顶部栏有所不同:图标具有不同的设计,右侧会显示“SAP CRYSTAL REPORTS”
After some frustrating times, it seems I have found a solution in 3 easy steps:
If you are using CR as a component, during runtime you will notice that the top bar of the component is different: the icons have different design and at right it will say "SAP CRYSTAL REPORTS"