ActiveReports 6 Online Help
CurrentLocation Property
Example 

Gets the location of the section being rendered on the page.
Syntax
'Declaration
 
Public ReadOnly Property CurrentLocation As PointF
public PointF CurrentLocation {get;}
Remarks

You can access this property only during the report's processing by using the property's Section.Format, Section.BeforePrint or Section.AfterPrint event.

The Section.Format event may return the incorrect value if some settings have been modified. The list of scenarios that you may encounter is as follows.


Section.KeepTogether = true The section is moved to next page if the section's height is larger than the remaining vertical area of the current page.
GroupSection.GroupKeepTogether = All/FirstDetail The whole group is moved to the next page if the group's height is larger than the remaining vertical area of the current page.
GroupSection/Detail.NewPage = Before/BeforeAfter/After The next group or detail is moved to the next page.
GroupSection/Detail.NewColumn = Before/BeforeAfter/After The next group or detail is moved to the next column.
GroupSection.ColumnGroupKeepTogether = true The group is moved to the next column if the group's height is larger than the remaining vertical area of the current column.
ReportFooter The report footer is moved to the next page if the first column does not contain the last detail section on the current page.
Subreport The subreport sections may be printed on the next page.

Note: The System.InvalidOperationException error occurs if the property is accessed out of the Section.Format, Section.BeforePrint or Section.AfterPrint event.

Example
Sub Detail1_Format
    DrawCurrentLocation(Detail1)
End Sub 
Sub DrawCurrentLocation(section as Section)
    rpt.CurrentPage.DrawText(section.Name + section.CurrentLocation.ToString(), section.CurrentLocation.X, section.CurrentLocation.Y, 10, 10)
End Sub
public void Detail1_Format()
{
    DrawCurrentLocation(Detail1);
} 
void DrawCurrentLocation(Section section)
{
    rpt.CurrentPage.DrawText(section.Name + section.CurrentLocation.ToString(), section.CurrentLocation.X, section.CurrentLocation.Y, 10, 10);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Section Class
Section Members

Send Feedback