简体   繁体   中英

how can i add a .jpg file in local report(.rdlc) in c# withour storing the pics in database

我如何在C#中的本地报表中添加.jpg文件并将图片存储在数据库中

There are three ways to get an image on a Microsoft Reporting Document.

Database
Embedded
External

I guess you know how do database by your question. Chalkey gives a great example of how to do an embedded image. (This is the approach I generally take.) Finally there are external images. For external you can set the property on the image to external and either refernece a file path or even a url in the value property. Lastly you have set the external image property too in code:

ie reportViewer1.LocalReport.EnableExternalImages = true;

Hope that helps.

When you are designing your report in Visual Studio click on Report from the menu bar and then Embedded images . Select the image you want and click ok. Next from the toolbar add a new image onto the report. Goto the properties of that image and select Source as Embedded . The Value property will now contain the image you just embedded into the report.

我不确定100%“ C#本地报告”的含义,但我可能会冒险猜测,建议您将图片文件添加到项目的图片资源中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM