在运行时动态更改

在运行时动态更改

本文介绍了在运行时动态更改 Crystal Report 中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VisualStudio 2005 中包含的 Crystal Reports.我想更改在运行时显示在报表上的图像,最好是通过构建图像文件的路径,然后让该图像显示在报表上.

I'm using the Crystal Reports included with VisualStudio 2005. I would like to change the image that is displayed on the report at runtime ideally by building a path to the image file and then have that image displayed on the report.

有人能用这个版本的 Crystal Reports 做到这一点吗?

Has anyone been able to accomplish this with this version of Crystal Reports?

推荐答案

在工作中,我们通过将图像作为数据表的字段推送到报告中来做到这一点.它不漂亮,但它完成了工作.当然,此解决方案要求您通过 DataSet 将数据推送到报表中.我一直觉得这充其量只是一个hack.我真的希望图像参数是 CR 的可能性.

At work we do this by pushing the image(s) into the report as fields of a datatable. It's not pretty, but it gets the job done. Of course, this solution requires that you push data into the reports via a DataSet. I've always felt this was a hack at best. I really wish that image parameters were a possibility with CR.

值得注意的是,如果您将水晶报表绑定到普通旧对象,您希望为报表公开一个 byte[] 属性以将其视为图像.

It's worth noting, if you are binding your crystal report to plain old objects you want to expose a byte[] property for the report to treat that as an image.

这篇关于在运行时动态更改 Crystal Report 中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 18:34