How do I load images dynamically in Crystal Reports XI

混江龙づ霸主 提交于 2019-12-10 11:47:00

问题


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)


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2279270/how-do-i-load-images-dynamically-in-crystal-reports-xi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!