Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Default ReportObject Name Property is sticky Post Reply Post New Topic
Author Message
ultraspxse
Newbie
Newbie


Joined: 04 Nov 2007
Location: Canada
Online Status: Offline
Posts: 4
Quote ultraspxse Replybullet Topic: Default ReportObject Name Property is sticky
    Posted: 06 Nov 2007 at 1:20pm

Refering to the Name property of a text type ReportObject doesn't always work.

When a textbox is placed on a report, it is automatically given a default name with a number incremented as each new text control is added (i.e. "Text1")
 
If you change the Name property of this control (i.e. "txtNewName"), Hit Enter to make sure the name is reflected in the Control List dropdown and then try to refer to it via the ReportDocument.ReportDefinition.ReportObjects.Item("txtNewName") it sometimes errors with System.IndexOutOfRangeException because it can't find this name to dereference the control.
 
Sometimes it works and sometimes it doesn't. When it doesn't, successive name changes on the control, resaveing, closing and reopening the report does not fix this problem.
 
Has anyone found a way to revert this without a huge amount of effort having to to replace the controls with a new control?
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 06 Nov 2007 at 1:51pm

Which version of CR are you using?

Also I am not clear when you say 'Control Drop Drown List' are you talking about the VS ddl  above the properties window, or is there one you are referring to on the report itself.

Because I am not clear, I cant tell exactly where you doing the renaming; have  you tried renaming the control on the report itself?

Regards,

John W.
 
IP IP Logged
ultraspxse
Newbie
Newbie


Joined: 04 Nov 2007
Location: Canada
Online Status: Offline
Posts: 4
Quote ultraspxse Replybullet Posted: 11 Nov 2007 at 8:37am

Version 10.2.3600.0

Problem Solved! The report is being used as a subreport. Changes to the subreport were not being reflected when executing the parent report that contains the subreport object container. I now discovered that re-importing the subreport refreshes the changes done to the subreport.
 
I had assumed that since the subreport container on the parent report is already linked to the actual subreport file that changes would be reflected automatically.
 
Thanks
Greg
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.