问题
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