简体   繁体   English

Crystal Reports在运行时加载图像

[英]Crystal Reports image loading on runtime

I have some reports with many records. 我有一些记录很多的报告。 Those records have images. 这些记录有图像。 They were coming from a .NET Dataset object. 它们来自.NET数据集对象。 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. 最初,我是使用System.Byte []列来将图像的内容放入记录中的,但是报告占用了太多的时间来加载。

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. 按照《 Crystal Reports用户指南》中描述的实践,我插入了一个“ Paintbrush图片类型”的OLE对象,其图像的“图形位置”与数据库表字段相同。 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. 因此,我在报告中添加了两个以上的OLE对象项进行测试:第一个的图形位置和超链接具有第一个记录的图像的文件路径。 It is a .jpg file. 这是一个.jpg文件。

I created additionally a .bmp copy of that image and set the second item's filepaths to point to this image. 我另外创建了该图像的.bmp副本,并将第二项的文件路径设置为指向该图像。

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. 当我在Visual Studio 2010 Crystal Reports设计器上单击“预览”时,可以看到图像,但不能在运行时看到图像。

So, what am I missing for the images to show? 那么,要显示的图像我缺少什么呢?

additional info: VS 2010 premium 附加信息:VS 2010高级版

.Net framework 4 .NET Framework 4

Windows 7 64 bits Windows 7 64位

Crystal reports is integrated on Visual Studio 水晶报表已集成在Visual Studio中

Thanks in advance, Sérgio 在此先感谢,塞尔吉奥

After some frustrating times, it seems I have found a solution in 3 easy steps: 经过一段时间的挫折之后,似乎我可以通过3个简单的步骤找到解决方案:

  • Uninstall every component of Crystal Reports for VS 2008 卸载VS 2008的Crystal Reports的每个组件
  • Reopen Visual Studio 2010 重新打开Visual Studio 2010
  • Clean & Rebuild Solution 清洁和重建解决方案

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" 如果将CR用作组件,则在运行时您会注意到组件的顶部栏有所不同:图标具有不同的设计,并且在右侧会显示“ SAP CRYSTAL REPORTS”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM