Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Move Line Object Post Reply Post New Topic
Author Message
ravikumarmittal
Newbie
Newbie


Joined: 11 Aug 2009
Location: India
Online Status: Offline
Posts: 3
Quote ravikumarmittal Replybullet Topic: Move Line Object
    Posted: 11 Aug 2009 at 9:22pm
Hi can any one help me how to move crystal report Line (left position) run time.
 
 
I have designed a new dynamic report all text box  are moveable left and right but i am not able to move the line object like text box. Pleaes help me how i can solve this problem. If possible please provide me runnign code.
 
Thanks a ton...
 
Ravi
 

ReportDocument reportDocument = new CrystalReport1();

ReportObject reportObject = reportDocument.ReportDefinition.ReportObjects["Line1"];

LineObject lineObject = (LineObject)reportObject;

int top = lineObject.Top;

int bottom = lineObject.Bottom;

lineObject.Top = 500;

lineObject.Left = 2000;

crystalReportViewer1.ReportSource = reportDocument;

 
 
 
IP IP Logged
ravikumarmittal
Newbie
Newbie


Joined: 11 Aug 2009
Location: India
Online Status: Offline
Posts: 3
Quote ravikumarmittal Replybullet Posted: 18 Aug 2009 at 4:54am

it is done

IP IP Logged
zirc75
Newbie
Newbie
Avatar

Joined: 10 Sep 2009
Online Status: Offline
Posts: 1
Quote zirc75 Replybullet Posted: 10 Sep 2009 at 9:45am
Hi
 
can you show me how you did? I'm still gettin error: "The line object's coordinates are not valid. Only vertical or horizontal lines are supported."
 
Thanks!
IP IP Logged
sharad
Newbie
Newbie


Joined: 31 Jan 2011
Online Status: Offline
Posts: 1
Quote sharad Replybullet Posted: 31 Jan 2011 at 5:34pm
I am facing the same problem , please suggest me if there is any solution to move the line object in the crystal report from code. specially moving the vertical line's left, right position and moving horizontal line's top, bottom property.

//the 'Line2' is vertical line
LineObject line = (LineObject)this.reportDocument.ReportDefinition.Sections["DetailSection"].ReportObjects["Line2"];

            int top = line.Top;
            int bottom = line.Bottom;

            line.Top = 300;
            line.Bottom = 300;

          line.Left = 3423;
           line.Right = 3423;

            line.Top = top;
            line.Bottom = bottom;


the code does not raise  error but the line won't display in the report.

plz if there is any solution suggest me.
           
sharad subedi
IP IP Logged
nghiahvan
Newbie
Newbie


Joined: 06 Sep 2011
Online Status: Offline
Posts: 1
Quote nghiahvan Replybullet Posted: 06 Sep 2011 at 5:46am
Hi, my solution:
1. Insert a horizontal line in detail (Section 3)
2. Copy following Code to form
        Dim lobj As LineObject = rpt.Section3.ReportObjects("Line1")
        Dim top As Integer = lobj.Top
        lobj.Top = lobj.Bottom
        lobj.Right = 3000
        lobj.Left = 3000
        lobj.Top = top
        lobj.LineStyle = LineStyle.SingleLine

The line will move to left or right
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.031 seconds.