Add Image To Crystal Report At Runtime

牧云@^-^@ 提交于 2020-01-01 05:16:07

问题


I would like to add an image to a crystal report at runtime.

I am currently doing this using a second data table containing only a byte field and then a blob field on the report. However this feels like a hack and if there is no data in the first primary table then for some reason the image does not show.

Is it possible to add an image with code or another method?

I'm using crystal reports for visual studio 2010. Winforms project. Either C# or VB.


回答1:


If you want to store the logo on disk instead of in the database:

  1. In Designer, insert a placeholder image.
  2. Right-click the placeholder image, and click Format Graphic. On the Picture tab, next to Graphic Location, click the formula button. Enter the path there, or provide a formula which provides it.

At runtime, Crystal will substitute the image from the file.

If you want, you can use a parameter field in your formula. That way you can provide the path programmatically at runtime.



来源:https://stackoverflow.com/questions/7706662/add-image-to-crystal-report-at-runtime

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