How to insert dynamically images in Crystal Reports

為{幸葍}努か 提交于 2019-12-30 06:36:14

问题


I am developing a WinForms App which can generate a report of my college students.

I am using Crystal Reports but I don't know how to retrieve student photos from the file system.

Student photos are stored on the file system and use this naming convention:

C:\Id Maker\"Clgid".jpg

Where Clgid is a value stored in a database.

As an example my Clgid is 2009UCS020 which links to my photo on the file system as C:\Id Maker\2009UCS020.jpg

I am struggling on how I can lookup the database value of Clgid and then retrieve the photo from the file system so I can display it in my Crystal Report.


回答1:


First, add a graphic as a placeholder into your report where you want it to display. Then, right-click the graphic -> 'Format Graphic' -> 'Picture' tab -> Add a formula under 'Graphic Location' that builds your path string. Something like 'C:\Id Maker\' + {table.Clgid} + '.jpg' should work.



来源:https://stackoverflow.com/questions/9079118/how-to-insert-dynamically-images-in-crystal-reports

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