如何在 Crystal Reports XI 中动态加载图像 [英] How do I load images dynamically in Crystal Reports XI

查看:16
本文介绍了如何在 Crystal Reports XI 中动态加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在从 .NET 应用程序运行 Crystal Reports XI.我将参数名称作为公司传递,报告应显示徽标取决于公司.

HI I am running a Crystal Reports XI from .NET application. I am passing parameter name as company and report should display the logo depends on company.

我们如何在水晶报表中动态加载图像.(如何编写公式从特定目录加载图像)

How we can load the image dynamically in crystal report.(how to write formula to load the image from specific directory)

推荐答案

Crystal Reports XI 的一个简单解决方案是将图像的 URL 作为参数传递给报表,然后将其用作图片的图形位置.

A simple solution for Crystal Reports XI is to pass the image's URL as a parameter to the report, then use it as the picture's graphic location.

  • 创建一个字符串参数字段,命名为'imageUrl'.
  • 向报告中添加图片(插入 | 图片...)(它是一个占位符)
  • 更改图片的图形位置:
    • 右击图片
    • 选择格式化图形...
    • 选择图片标签
    • 点击条件公式按钮(看起来像 x+2)
    • 将公式的文本设置为{?imageUrl}"(不带单引号)
    • 保存公式并点击确定按钮
    • 保存报告

    运行报告并相应地设置 imageUrl 的值.

    Run the report and set the imageUrl's value accordingly.

    或者,您可以在公式字段中使用 CASE 语句以获得相同的效果;只需更改图像的条件公式字段以引用公式字段而不是参数字段.

    Alternately, you could use a CASE statement in a formula field for the same effect; simply change the image's conditional-formula field to reference the formula field instead of the parameter field.

    这篇关于如何在 Crystal Reports XI 中动态加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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