Presently I am using vb6 & cr9 using this to change pictures for each record in a name tag report in the form containing the viewer:
Private WithEvents crSection As CRAXDRT.Section
Private Report As CrystalReport1
Private Sub Form_Load()
Set Report = crNameTagsAdhesive
End Sub
Private Sub crSection_Format(ByVal pFormattingInfo As Object)
On Error GoTo ErrHandle
Set crSection.ReportObjects("Classmate").FormattedPicture = _
LoadPicture(Report.Sections("DetailSection3").ReportObjects("PicFile").Value)
crSection_Format_Exit:
Exit Sub
ErrHandle:
If Err.Number = 53 Then
MsgBox Err.Description, vbCritical, "No Photos"
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
End If
End Sub
If a record has a picture attached it shows on the report.
Tried to do the same thing with CR XI using the same code and get a 'Can not find QE property' error message.
Also tried putting this code in the report:
Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)
On Error GoTo Err
Set crNameTagsAdhesive.Classmate.FormattedPicture = _
LoadPicture(CrystalReport1.PicFile.Value)
detailsection1_format_exit:
Exit Sub
Err:
MsgBox Err.Number & " - " & Err.Description
Resume Next
End Sub
There is no error message but when the code is stepped through there is no value for CrystalReport1.PicFile.Value which leads me to believe that is the missing QE property. On further evaluation even if there is a value, the error message appeas 'can not find QE property'.
What changes need to be made to make this work in CR XI and, hopefully, in vs2008 cr10?
Thank you.
Edited by kimt - 25 Oct 2010 at 2:50am