views:

270

answers:

2

HI I am running a crystal report 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)

A: 

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.

Graham
A: 

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.

Craig