Print Page | Close Window

Move Line Object

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=7345
Printed Date: 18 May 2024 at 2:56pm


Topic: Move Line Object
Posted By: ravikumarmittal
Subject: Move Line Object
Date 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;

 
 
 



Replies:
Posted By: ravikumarmittal
Date Posted: 18 Aug 2009 at 4:54am

it is done



Posted By: zirc75
Date 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!


Posted By: sharad
Date 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


Posted By: nghiahvan
Date 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



Print Page | Close Window