How do I load images dynamically in Crystal Report

2019-06-07 16:04发布

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)

2条回答
forever°为你锁心
2楼-- · 2019-06-07 16:15

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.

  • 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

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

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.

查看更多
可以哭但决不认输i
3楼-- · 2019-06-07 16:15

I don't think you can. The only way I've found to do that is to embed each image in a different section of the report and conditionally suppressing the section depending on the company parameter's value.

查看更多
登录 后发表回答