问题描述
我正在开发一个WinForms应用程序,可以生成我的大学生的报告。
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
Clgid
是存储在数据库中的值。
Where Clgid
is a value stored in a database.
作为示例,我的 Clgid
是 2009UCS020
,其链接到我的照片在文件系统上作为 C:\Id Maker\2009UCS020.jpg
As an example my Clgid
is 2009UCS020
which links to my photo on the file system as C:\Id Maker\2009UCS020.jpg
我在努力查找 Clgid
的数据库值,然后检索
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.
推荐答案
首先,将一个图形作为占位符添加到您的报告您希望它显示的位置。然后,右键单击图形 - >'格式图形' - >'图片'选项卡 - >在'图形位置'下添加一个公式,构建你的路径字符串。像'C:\Id Maker \'+ {table.Clgid} +'.jpg'
应该可以工作。
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.
这篇关于如何在Crystal Reports中动态插入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!