Displaying Image in Crystal Reports 10 using C# through a File Path stored in a Database

♀尐吖头ヾ 提交于 2021-02-05 09:32:04

问题


I have a C# Windows Application that Stores Employee Data into a MYSQL Database including their picture's file path (\\192.168.13.6\IDPictures\Unknown.jpg).

Can someone help me on how to display the picture in a Crystal Reports 10 Report by reading the file path from the database?

I can't seem to find the answer. Please Help.


回答1:


1) Read the path.

2) Load the image: byte[] buffer = File.ReadAllBytes(path)

3) Put it into a column of type byte[] in your dataset: row[column] = buffer;

4) In Crystal, if your datasource is not the dataset, use a XSD file with a column of type base64Binary.

5) In Crystal, drag the field from the data source to the report.



来源:https://stackoverflow.com/questions/27180838/displaying-image-in-crystal-reports-10-using-c-sharp-through-a-file-path-stored

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