vb.net 使用物理路径在水晶报告中显示图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3170387/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 14:55:33  来源:igfitidea点击:

display image in crystal report using physical path

vb.netms-accesscrystal-reports

提问by Samir

i am using vb.net and access. in which i have one field in which i have saved only the path of that image. Now i want to display that image in crystal report dynamic.so what should i do? i want to fetch the image path in crystal report and display in it.

我正在使用 vb.net 和访问。其中我有一个字段,我只保存了该图像的路径。现在我想在水晶报告动态中显示该图像,那么我该怎么办?我想在水晶报告中获取图像路径并在其中显示。

please try to show me a code so i can identify

请尝试向我展示一个代码,以便我可以识别

reply me soon

尽快回复我

thanks

谢谢

回答by Dog Ears

This works in the more recent version of Crystal Reports (i'm using XI R2)

这适用于最新版本的 Crystal Reports(我使用的是 XI R2)

  • From the Insert Toolstoolbar select Insert Picture and insert any old picture in your report.
  • Right click on the image and select Format Graphic
  • On the Picturetab select the 'formular button' next to Graphic Location
  • From the Formula Workshopyou should be able to select the database column that contains your file path.
  • 从“插入工具”工具栏中选择“插入图片”并在报表中插入任何旧图片。
  • 右键单击图像并选择格式图形
  • 在“图片”选项卡上,选择“图形位置”旁边的“公式按钮”
  • 公式工作室,您应该能够选择包含文件路径的数据库列。

When you preview the report it should dynamicly load the images for each record.

当您预览报告时,它应该动态加载每条记录的图像。

EditI've found this link, it maybe useful.

编辑我找到了这个链接,它可能有用。

回答by Dirk Brockhaus

Don't use physical paths with CR directly. Store your image in a datatable or in a binary field of your database and show that.

不要直接在 CR 中使用物理路径。将您的图像存储在数据表或数据库的二进制字段中并显示出来。

Here is a code project solution that uses datatables:

这是一个使用数据表的代码项目解决方案:

http://www.codeproject.com/KB/vb/Image_in_Crystal_Reports.aspx

http://www.codeproject.com/KB/vb/Image_in_Crystal_Reports.aspx

It's simple, C# and a little old, but I think you get the trick.

它很简单,C# 和有点旧,但我认为你明白了。