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

查看:96
本文介绍了如何在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.

我们如何在Crystal Report中动态加载图像。(如何编写公式以加载来自特定目录的图像)

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}(不带单引号)

    • 保存公式,然后单击确定按钮

    • 保存报告

    • Create a string parameter field, call it 'imageUrl'.
    • Add an image (Insert | Picture...) to the report (it's a placeholder)
    • Change the image's Graphic Location:
      • right click image
      • select Format Graphic...
      • select Picture tab
      • click the conditional-formula button (looks like x+2)
      • set the formula's text to '{?imageUrl}' (without the single quotes)
      • save the formula and click the OK button
      • save the report

      运行报告并相应地设置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天全站免登陆