Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I would like to dynamically change the coordinates on a lineobject in my Crystal Report (Visual Studio 2005, C#, Crystal bundled version 10).

 

All the documentation and information I can find leads me to the LineObject properties Top, Bottom, Left and Right. They have set and get enabled, but there is a catch to their use which I haven't been able to figure out.

 

Crystal supports only vertical or Horizontal lines. During design time, the designer, automatically changes the corresponding property value to keep the line object either vertical or horizontal.

 

In a Horizontal line, left and right should be equal, and in a vertical line top and bottom should be equal. I cannot find a method where I can change both simultaneously and if I try to change one in one line of code, then the other in the next line of code, the first line generates a System.Runtime.InterOpServices.COMException with the added caveat that it didn't change the property value (otherwise I would nest catch- try blocks).

 

I tried looking for a method where I could construct a line then add the line to the report, or set the existing line equal to the newly constructed line, but I cannot find a constructor method for the lineobject.

Posted

hi,

 

I think the following code can solve your problem.

Attention about section you have to specify your correct section name and also your line name.

 

myReport _myReport = new myReport ();

myReport .Section1.ReportObjects["myline"].Top = 10;

 

rgds,

Tiago Teixeira

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...