ActiveReports Developer 7
LayoutAction Property
See Also  Example
GrapeCity.ActiveReports.v7 Assembly > GrapeCity.ActiveReports Namespace > SectionReport Class : LayoutAction Property

Glossary Item Box

Sets or returns a custom action following the rendering of the current record.

Syntax

Visual Basic (Declaration) 
Public Property LayoutAction As LayoutAction
C# 
public LayoutAction LayoutAction {get; set;}

Property Value

Current layout action.   The default is LayoutAction.MoveLayout | LayoutAction.NextRecord | LayoutAction.PrintSection, which returns a value of 7.

  • PrintSection has a value of 1.
  • MoveLayout has a value of 2.
  • NextRecord has a value of 4.

Remarks

ActiveReports automatically performs the following actions for each record in the data source after each Detail section format:

  1. Prints the section.
  2. Moves the layout (sets the next print position for the rest of the report).
  3. Moves to the next record.

The LayoutAction property allows you to control which of these steps should be performed or omitted. Using a combination of layout actions when the report is executed can change a report's layout.

This property can be used only in the Detail section's Format event.

The following table shows the results of different combinations of LayoutActions

Value Print Layout NextR Description
7 True True True (Default) Move to next print location, get next record, and print data.
3 True True False Move to the next print location, don't advance to the next record, but print the data.
4 False False True Skip a record without leaving a blank space on the page.
6 False True True Skip a record and leave a blank space on the page.
2 False True False Leave a blank space without skipping a record.
5 True False True Print the next record on top of the current record (UnderlayNext).

Example

C#Copy Code
int counter=0; 
private void detail_Format(object sender, System.EventArgs eArgs)
{
    //repeat each row five times
    counter = counter + 1; 
    if (counter <= 4) 
    { 
        this.LayoutAction =  GrapeCity.ActiveReports.LayoutAction.LayoutAction.MoveLayout|GrapeCity.ActiveReports.LayoutAction.LayoutAction.PrintSection; 
    } 
    else 
    { 
        this.LayoutAction = GrapeCity.ActiveReports.LayoutAction.LayoutAction.MoveLayout|GrapeCity.ActiveReports.LayoutAction.LayoutAction.NextRecord|GrapeCity.ActiveReports.LayoutAction.LayoutAction.PrintSection; 
        counter = 0; 
    }
}
Visual BasicCopy Code
Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
    'repeat each row five times
    Static counter As Integer
    counter = counter + 1
    If counter <= 4 Then
        Me.LayoutAction = 3
    Else
        Me.LayoutAction = 7
        counter = 0
    End If
End Sub

See Also