cancel
Showing results for 
Search instead for 
Did you mean: 

Name Tags CR9 vs CRXI R2

Former Member
0 Kudos

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. This code works in VB6 with CR9.

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

Ludek Uher from the legacy forum suggested that I post here the query which was duplicated in the designer:


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

There is a picture (placeholder picture) for each person including spouses.

I commented out the first section of code above in vb6/CRXI R2 and no change. Therefore it seems that there needs to be some changes in that section.

Any ideas are appreciated.

Thanks.

Kim

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Former Member
0 Kudos

If you mean to start a new thread, what would that accomplish?

Former Member
0 Kudos

Don is a moderator and is closing threads that have not had any resent activity. He is saying if you are looking for more assistance on this subject you should start a new thread.

Former Member
0 Kudos

And to my other question, to what purpose does that serve? If this thread does not arose the collective intellect then what makes you or Mr. Wiilams think that starting a new thread would stimulate anyone? Appears that the only activity would be for Mr. Williams to come back in a month or two and make the same request. N'est ce Pas?

0 Kudos

Hello,

A lot of people post questions and then just go away. Marking them as answered is a way of getting a response and if it's something that our PUBLIC forums can not answer then purchasing a case and working with a Support engineer can resolve the issue. This is NOT a case management system, if you don't get a response then purchase a case.

Just to clarify. Posting programming issues in the Report Forum without indicating you tried it first in the designer typically doesn't get a response.

Also, the RDC in VB 6 has been deprecated, porting the same functions into the .NET viewers is sum times not possible due to the way .NET works. We are adding more features to RAS, Report Application Server, which allows you to make changes.

And you cannot use or compare the craxddrt to .NET functionality, it's an an unsupported runtime report engine. Craxddrt is the embedded designer control for use in VS only. You can not distribute it nor use it as your report engine.

In .NET you have to use the Windows Form viewer for your application.

To your issue....

To update pictures use the Report Designer in CR XI or CR XI R2 to create your reports. The older versions of CR including CR 10 would only update the pictures of linked objects when the report was opened. Refreshing did NOT update the image.

In CR XI and above you now have the ability to use a database field to specify where the image files are saved. You create the report this way first though. Unless you update to RAS and then you can add pictures on the fly. ( code sample below )

So to make this work, you cannot use the runtime from VS 2008 and need to upgrade to CR XI R2 or CR 2008. You can upgrade to CR XI R2 for free by downloading Service Pack 4 Full build and install it with your CR XI keycode. CR 10.5 which is included with VS 2008 does not support this feature in our .NET components.

2 options:

1. Create your report using a database field to specify where the images are ( download the samples to see how this works or refer to the CR help file for more info.

2. Use RAS to add the images at runtime.

Sample code:

private void PictureData_Click(object sender, EventArgs e)

{

rptClientDoc = new ReportClientDocumentClass();

CrystalDecisions.ReportAppServer.ReportDefModel.PictureObject boPictureObject;

CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;

rpt.Load(@"C:\temp\imageReport.rpt");

rptClientDoc = rpt.ReportClientDocument;

String MyfilePath = "C:
temp
sample1.jpg";

//Determine which section to add the picture field to - in this case the report header section

boSection = rptClientDoc.ReportDefController.ReportDefinition.ReportHeaderArea.Sections[0];

//Add it to the report

boPictureObject = rptClientDoc.ReportDefController.ReportObjectController.ImportPicture(MyfilePath, boSection, 1, 1);

}

Thank you

Don

Former Member
0 Kudos

Thank you for your response. It seems that if I cannot use the picture thingy in VS2008 with cr10.5 without an upgrade then there is no reason to first buy any support package. Guess I will have to upgrade to vs2008 to make this work, correct? If so, I'm sure I will be back.

0 Kudos

No, you have to upgrade to CR 2008, not VS 2008. VS 2008 still uses CR 10 version, just an update from 10.2 to 10.5.

If you plan to upgrade to VS 2010 then download the CR for VS 2010, it'll go GA very soon, and it has full functionality, you don't get the full Crystal Report Designer though.

Thank you

Don

Former Member
0 Kudos

Thank you for your help.

Former Member
0 Kudos

Some additional info is these references are set in both VB CR9 and VB CRXI:

Crystal Reports Report Viewer (version #)

Crystal Reports ActiveX Designer Runtime Library (version #)

and this is dimmed for module use:

Private WithEvents crSection As CRAXDRT.Section

In both CR9 and CRXI the same results of placeholder picture returned for all names.

In VS2008 using CR 10.5 using the previous code - same results

      
  Private WithEvents crSection As CRAXDDRT.Section  'this reference changed from CRAXDRT

  crSection.ReportObjects("Classmate").FormattedPicture = _     'squiggly says this is late bound
                  LoadPicture(crNameTagsAdhesive.Sections("DetailSection3").ReportObjects("PicFile").Value)
                 'LoadPIcture and crNameTagsAdhesive squiggly says not declared.

Can't understand why the two - CR9 and CRXI - does not produce the same results.

Does anyone have the language to make either or both to work?

Thank you.

Kim

Put this into the ErrHandle:


 Set crSection.ReportObjects("Classmate").FormattedPicture = _
        LoadPicture(crNameTagsAdhesive.Sections("DetailSection3").ReportObjects("PicFile").Value)
     
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.Description                         'msg is error 9, subscript out of range
    End If

Need some help on this one.

Thanks.

Edited by: homebrewer on Sep 6, 2010 10:43 PM