Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# - Setting Text in TextObject for Crystal Report

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I have struggled with setting the text in a TextObject within a Crystal Report.
I am using Visual Studio .NET C# and am trying to set the text in a TextObject in a Crystal Report (created in CR8).
My syntax follows :

ReportDocument crystalRpt = ReportDocument()
crystalRpt.Load(path-here);
TextObject textObject;
textObject = crystalRpt.ReportDefinition.Sections[1].ReportObjects[0] as TextObject;
textObject.Text = "ONE THING AFTER ANOTHER";

The problem I seem to get with this is that I only get the first few characters of this string displayed in my TextObject (the first / only one in my second section - indexed 1). The number of characters I get shown seems to be dependent on the length of the string I put into the textObject through the Crystal Report Designer itself.

How can I ensure that I am able to fully set the 'Text' against a TextObject including carriage returns and the like.

Any help would be appreciated.

Is it due to the fact that I'm using Crystal Reports 8 ?

Thanks in advance
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top