on 09-02-2010 5:58 PM
Have a report for name tags that will show a picture if one is present for each record. If no picture, just the name is printed. There are three sections, First Name + place holder for the picture, Maiden name and Last Name + a hidden field for class photo. A photo is only inserted for the Last name on the record. No photo for the spouse.
The code used in both versions of Crystal Reports is:
Private Sub crSection_Format(ByVal pFormattingInfo As Object)
On Error GoTo ErrHandle
Set crSection.ReportObjects("Classmate").FormattedPicture = _
LoadPicture(crNameTagsAdhesive.Sections("DetailSection3").ReportObjects("PicFile").Value)
crSection_Format_Exit:
Exit Sub
ErrHandle:
End Sub
This is what calls the report:
cmd.CommandText = "SELECT FirstName, LastName, MaidenName, ClassYear, ClassPhoto," & _
" ClassYear AS OrderYear," & _
" LastName AS Sortname, 1 AS SortOrder" & _
" FROM Members INNER JOIN Attending ON Members.ID = Attending.ID" & _
" Where Attending.numAttend > 0" & _
" UNION ALL SELECT Spouse, LastName, Null, Null, Null," & _
" ClassYear, Lastname, 2 As SortOrder" & _
" FROM Members INNER JOIN Attending ON Members.ID = Attending.ID" & _
" WHERE Attending.numAttend > 1" & _
" ORDER BY OrderYear, Sortname, SortOrder"
End If
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
Set rs = cmd.Execute
crNameTagsAdhesive.DiscardSavedData
crNameTagsAdhesive.Database.SetDataSource rs
crNameTagsAdhesive.ReadRecords
With CRViewer1
.Refresh
.ReportSource = Report
.ViewReport
.Zoom (60)
.EnableExportButton = False
.DisplayTabs = False
.EnableGroupTree = False
.EnableCloseButton = False
End With
CRXI R2 doesn't play nice since there is a picture (placeholder picture) for each person including spouses.
Any ideas are appreciated.
Thanks.
Kim
This is now beyond the abilities of forums.
I suggest you purchase a case and have a dedicated support engineer work with you directly:
http://www.sdn.sap.com/irj/boc/gettingstarted
Or
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not that I am aware of. You may want to start a new Discussion that summarizes and explains the issue as you see it (this one has info spanning 2 pages and a number of posts). Include version of CR used (include service packs applied). Please do note that CR XI R2 has been out of support for over two years, so no fixes and thus your only option may be CR 2013 designer and SAP Crystal Reports, Developer Version for Visual Studio .NET
- Ludek
I am actually investigating upgrading to the latest version but am having problems with that. (see here: http://scn.sap.com/message/15462853#15462853)
I was simply wondering if there was information on what the QE property error was or typically why it comes up. I found somewhere that someone believed this was caused be a memory issue, but nothing official.
I am a programmer and have really only heard of this QE property error with Crystal Reports, although there are a very few reports of this on the web, and some of them appear to refer to other applications. It is frustrating to not even know what the QE property is and therefore have no idea what direction to go to address the issue.
The unfortunate thing is that only some client machines get this message which makes it very difficult to find the cause.
Anything you can provide about this would be appreciated. FYI this is with Crystal XI R2 SP6 FP4.
Thank you
Seradex
QE errors would indicate a database connection issue when using the RAS SDK. E.g.; using this code:
/* ODBC | |
// create logon attributes | |
m_boAttributes = new PropertyBag(); | |
m_boAttributes["Database DLL"] = "crdb_odbc.dll"; | |
m_boAttributes["QE_DatabaseType"] = "ODBC (RDO)"; | |
m_boAttributes["QE_ServerDescription"] = "ODBC - Xtreme Sample Database 11.5"; | |
m_boAttributes["QE_SQLDB"] = true; | |
m_boAttributes["Server Name"] = "Xtreme Sample Database 11.5"; |
if one of the parameters is incorrect, a QE error is one of the possible outcomes. For now, without a bit more info (db, connection type, etc., etc) that is about all I can say...
- Ludek
Only suggestion I have is the latest Service Pack:
https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
If that does not resolve the issue, this may be a bug and unfortunately, CR XI R2 is out of patch support now...
Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From what I can see in the code, you're creating a recordset and passing that to the report. Is the report created off of a TTX file? If so, can you verify the report against that TTX? If not, can you recreate the TTX and verify the report against that? What about rather than creating a recordset, you create a temp table with that data and pass that to the report? In this way, we could test this in the designer which is always a better way to go.
Ludek
Thanks for the response, Ludek.
Don't know about TTX. Report is created directly from the recordset and database tables. How to create a ttx file?
Created a temp table with only the Firstname, Lastname, Maiden, Spouse, ClassYear, ClassPhoto and NumAttend. wrote this sql:
SELECT FirstName, LastName, MaidenName, ClassYear, ClassPhoto, ClassYear as SortYear,
Lastname AS SortName, 1 AS SortOrder
FROM Members
WHERE NumAttend>0
UNION ALL SELECT Spouse, LastName, Null, Null, Null, Classyear, Lastname, 2
FROM Members
WHERE NumAttend>1
ORDER BY SortYear, SortName, SortOrder
Same results - placeholder pic in all photos. Did this in CR XI R2 Sp6. It seems that the results would be the same whether it is done in Crystal 11.5 or through VB6?
Temp table and report are available.
Thank you.
Hello Kim:
Thank you for trying the temp table. Right now, I'd rather keep away from TTX files. These are legacy "beasts" - in every sense of the word and we don't want to get anywhere close to those if we don't have to.
Since the issue can be duplicated in the designer, I wonder if I can ask you to please post the query to the [CR design|; forum and see if they can help us out there.
Ludek
Ludek,
Went to the other forum and no answers as of yet.
I did, however, change the on error go to procedure to include all errors. Discovered that this part is what is causing error # 9, Subscript out of range.
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
Else
MsgBox Err.Number & " - " & Err.Description
End If
End Sub
Hopefully, that gives you more info.
Thanks.
Kim
Ludek,
Many thanks for your time. The program can add pictures associated with a record. That picture is then picked up by Crystal report. If there is no picture for the record, then the name tag prints only the name. The attached jpg is an example. Bartelt, Peterson and Ritger are classmates. MA Peterson is a spouse therefore no pic. Bartelt, as a classmate, has no pic.
[http://classreunionprogram.com/downloads/nametags.jpg]
The same pic you see is the place holder and should not be in any of the name tags unless that pic is in a saved record.
Let me know if you have any questions.
Thank you.
Kim
Ludek,
This is in VB6 using CR XI R2.
When the declaration 'Private Report as New CrystalReport1' is used, then the error 'Subscript out of range' is issued by the Sub crSection_format:
Private WithEvents crSection As CRAXDRT.Section 'Insert name tag
Private Report As New crCrystalReport1 'this causes a 'subscript error' or so it seems
Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset
Private cmd As New Command
Private Sub crSection_Format(ByVal pFormattingInfo As Object)
On Error GoTo ErrHandle
Set crSection.ReportObjects("Classmate").FormattedPicture = _
LoadPicture(Report.Sections("DetailSection1").ReportObjects("PicFile").Value)
crSection_Format_Exit:
Exit Sub
ErrHandle:
If Err.Number = 53 Then
MsgBox Err.Description & vbCrLf & _
"Photos must be in C:\ProgramData\My Class Reunion\Photos directory.", vbCritical, "No Photos"
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
End If
End Sub
In the load form sub changing Report to CrystalReport1 eliminates the 'subscript' error
Report.DiscardSavedData 'change all Report to CrystalReport1 'eliminates subscript' error
Report.Database.SetDataSource rs, 3
Report.ReadRecords
CRViewer1.ReportSource = Report
However, then the place holder pic shows up for all records in the report.
Ludek,
Thanks for the response. At one time I thought the craxxdrt.dll was used for external reports in vb6 and craxdrt.dll was used for internal reports. Seems that it should not matter.
At any rate, here is a graphic that shows how the name tag[ report |http://classreunionprogram.com/downloads/nametags_cr9.jpg]works with CR9 and VB6. This should give you a better idea of what is needed with CR XI R2 or for that matter CR 10.5 with VS 2008.
Kim
My main OS is 7 which has among other programs both CR9 and CR XI R2 Sp6. Also have a Virtual PC with Windows XP mode. In OS7 only one name tag report prints, two show the qe property msg. All other reports work.
Took that file and copied to the VPC and all reports, including three name tag reports.
Could one conclusion be that there is something going on with CR XI R2?
Ludek,
Now, when any of the reports are called in VB6, a run time error 713 'Application defined or object defined error' pops up. In this application I am using mostly CR9 viewers, however, on one I placed a CR XI R2 viewer as a test to see if the error could be eliminated. Same results. The error only occurs when deploying the app not when in development mode. This is happening on a VPC running XP mode and also on a 64 bit machine. Any ideas on that?
Earlier in this thread you mentioned that whenever 'Cannot find the QE property' message appears it means that something is missing. I am using CRAXdrt.dll. Do you have anything specific for this message?
Is there an update for the file(s) uploaded a while back?
Thanks for your help.
Kim
Cannot find QE property refers to this part of the form holding the viewer:
Set crSection.ReportObjects("Classmate").FormattedPicture = _
LoadPicture(Report.Sections("DetailSection3").ReportObjects("PicFile").Value)
The name tags have four (4) fields plus an ole object/picture and they are Firstname, Lastname, Maidenname and classphoto.
This only occurs using vb6 and CRXI R2. If this is commented out then the picture being used as place holder shows up on all name tags. If an ole object is inserted and the above is not used then no pictures are displayed on the name tag.
It seems that there are instances where a picture is used in a Crystal report using XI. Is there any place where that the picture would change such as on name tags? If so, how to?
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.