我想在CryStal 中加入字段(字符型 圖片名稱) 但須顯示其圖片內容!!!!
急,急!!!!!!!!!!
How to change an image in a report at runtime using the RDC
The information in the article refers to:
Report Designer Component 7
Applies to:
Reported version only
OLE Object or Picture Object
Change at runtime
Synopsis
How to change the image for an OLE Object (set to a Bitmap Image) or Picture Object at runtime using the Report Design Component (RDC).
Solution
To change an image at runtime set the FormattedPicture property of the OLE Object (Object Type set to Bitmap), or Picture Object using the Microsoft Visual Basic function LoadPicture.
The filepath parameter of the LoadPicture function can be a string, a variable , or a field value.
In this example the filepath is from a field value:
The report has three fields from the Employee table and an OLE Object (Object Type set to Bitmap), or Picture Object in the Detail section. Field1 is the Employee Name field, Field2 is the Last Years Sales field, and Field3 is the path to the bitmap of the employees picture. Field3 is suppressed because only the field value is needed to load the picture.
This code applies to Section Format Events in a DSR.
Section 3 is the detail section
Private Sub Section3_Format(ByVal pFormattingInfo As Object)
Pass the path from field3 to the Visual Basic LoadPicture function.
The picture is then loaded into the OLE Object
Set Picture1.FormattedPicture = LoadPicture(Field3.Value)
End Sub
Note: When exporting the report the Section Format event is not executed resulting in the updated image not being exported..
--------------------------------------------------------
不知這個效果怎做,我一直做不出來(只用crystal reports、不用VB)
CR 中 自定DLL的用法(轉TONY的)
在为Crystal Report编写自定义函数时,ActiveX DLL的文件命名必须是有规则的,规
则是:文件名=CRUFL + 类名 + 函数名(CRUFL前缀是必须的,后面可以根据需要命名)
,现举例如下:
Example:
Option Explicit
Public UFPrefixFunctions As Boolean
Private Sub Class_Initialize()
UFPrefixFunctions = False
End Sub
Public Function DateToString(date1 As Date) As String
DateToString = Format(date1, "Long Date")
End Function
编译后,将此DLL文件拷贝至WINNT/Crystal目录下,如果此时Crystal Report
Designer处于打开状态请将其关闭。这样当再次打印Crystal Report Designer时在
Formula Editor的Additional Functions中将可以看到DateToString函数。其调用方法
与Crystal Report提供的系统参数一致。试试吧!