问题描述
我想在我的报告中显示一个图像,我将图像的路径保存在我的 sqlserver 数据库中,现在我想从路径加载图像.我搜索所有互联网并尝试所有指导,我首先将图像插入我的报告,然后我转到 >Format Editor >图片>图形位置 >
并将图像路径插入到 textarea 中,像这样 {Command.path}
但是当我运行时,它不显示任何图片.现在我该怎么办?
我使用visual studio 2013和最新版本的水晶报表.
I want to show an image in my report , I save path of image in my sqlserver database and now I want to load image from path .I search all of internet for that and try all of guidance , I first insert image into my report and after that I go to >Format Editor > picture > Graphic Location >
and insert path of image into the textarea like this {Command.path}
but when I run , it doesn't show any picture . Now how should I do ?
I use visual studio 2013 and latest version of crystal report .
推荐答案
Use a conditional formula to dynamically change the location of a report’s image.
1. Add an image to the report: -> Insert -> Picture
This image will act as a placeholder.
Ensure that the placeholder is the same size as the one that will be dynamically loaded, otherwise, the image will be scaled.
2. 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 the name of the formula or parameter field that will contain the image’s URL
->save the formula and click the OK button
->Save the report
It worked for me.
Source: cogniza.com
这篇关于从水晶报表中的路径加载动态图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!