Print Page | Close Window

how to set series label text at runtime

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12845
Printed Date: 20 Apr 2025 at 10:53pm


Topic: how to set series label text at runtime
Posted By: toob
Subject: how to set series label text at runtime
Date Posted: 07 Apr 2011 at 8:30am
Hi,

Crystal Reports    AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005

I'm using CR for VS2005 and when I create charts the series / group labels can read like "Sum of xxx" or "Max of xxx". These are the fields as they are in the designer / chart expert / data / Show value(s): and I cannot find a way to change them. Tried right clicking and properties.

 It would seem that this is a limitation of CR built into VS2005 VB .net as after googeling, some have suggested placing a text box over the chart to hide the default label text. Not ideal

I've found this code to handle adding custom text to CR text objects:

  Dim myTextObjectOnReport As CrystalDecisions.CrystalReports.Engine.TextObject
            myTextObjectOnReport = CType(newRpt.ReportDefinition.ReportObjects.Item("Text1"), CrystalDecisions.CrystalReports.Engine.TextObject)
            myTextObjectOnReport.Text = "some text"

This works for a text object but it started me thinking if there was something similar I could use to change the chart series / group label text?

Does anyone know if this is possible and if so what the syntax would be?

thanks in advance
Mark



Print Page | Close Window