<?xml version="1.0"?>
<Reports>
  <!--Report *** Group Page Counts ***-->
  <Report version="2.5.20061.196">
    <Name>Group Page Counts</Name>
    <ReportInfo />
    <DataSource>
      <ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=?(SpecialFolder.MyDocuments)ComponentOne Samples\Common\c1nwind.mdb;Persist Security Info=False</ConnectionString>
      <RecordSource>PARAMETERS 
         [Beginning Date] DateTime 1/1/1994,
         [Ending Date] DateTime 1/1/1995,
         [Sales Goal] Int 15000;
SELECT DISTINCTROW Employees.Country, Employees.LastName, Employees.FirstName, Orders.ShippedDate, Orders.OrderID, [Order Subtotals].Subtotal AS SaleAmount
         FROM Employees INNER JOIN (Orders INNER JOIN [Order Subtotals] ON Orders.OrderID = [Order Subtotals].OrderID) ON Employees.EmployeeID = Orders.EmployeeID
         WHERE (((Orders.ShippedDate) Between [Beginning Date] And [Ending Date]));</RecordSource>
    </DataSource>
    <Layout>
      <Orientation>1</Orientation>
    </Layout>
    <Font>
      <Name>Verdana</Name>
      <Size>9</Size>
    </Font>
    <Groups>
      <Group>
        <Name>Country</Name>
        <GroupBy>Country</GroupBy>
        <Sort>1</Sort>
        <KeepTogether>2</KeepTogether>
      </Group>
      <Group>
        <Name>LastName</Name>
        <GroupBy>=[LastName] &amp; "," &amp; [FirstName]</GroupBy>
        <Sort>1</Sort>
        <KeepTogether>2</KeepTogether>
      </Group>
      <Group>
        <Name>OrderID</Name>
        <GroupBy>OrderID</GroupBy>
        <Sort>1</Sort>
      </Group>
    </Groups>
    <Sections>
      <Section>
        <Name>Detail</Name>
        <Type>0</Type>
        <Height>255</Height>
      </Section>
      <Section>
        <Name>Header</Name>
        <Type>1</Type>
        <Height>4355</Height>
        <BackColor>11829830</BackColor>
      </Section>
      <Section>
        <Name>Footer</Name>
        <Type>2</Type>
        <Height>1440</Height>
      </Section>
      <Section>
        <Name>PageHeader</Name>
        <Type>3</Type>
        <Visible>0</Visible>
      </Section>
      <Section>
        <Name>PageFooter</Name>
        <Type>4</Type>
        <Height>845</Height>
        <BackColor>11829830</BackColor>
      </Section>
      <Section>
        <Name>Country_Header</Name>
        <Type>5</Type>
        <Height>465</Height>
        <Repeat>-1</Repeat>
      </Section>
      <Section>
        <Name>Country_Footer</Name>
        <Type>6</Type>
        <Height>780</Height>
        <ForcePageBreak>2</ForcePageBreak>
      </Section>
      <Section>
        <Name>LastName_Header</Name>
        <Type>7</Type>
        <Height>1515</Height>
        <CanShrink>-1</CanShrink>
        <Repeat>-1</Repeat>
        <OnFormat>If SalespersonTotal &gt; [Sales Goal] Then
  ExceededGoalLabel.Visible = True
  SalespersonLine.Visible = True
Else
  ExceededGoalLabel.Visible = False
  SalespersonLine.Visible = False
End If</OnFormat>
      </Section>
      <Section>
        <Name>LastName_Footer</Name>
        <Type>8</Type>
        <Height>645</Height>
      </Section>
      <Section>
        <Name>OrderID_Header</Name>
        <Type>9</Type>
        <Visible>0</Visible>
      </Section>
      <Section>
        <Name>OrderID_Footer</Name>
        <Type>10</Type>
        <Visible>0</Visible>
      </Section>
    </Sections>
    <Fields>
      <Field>
        <Name>titleLbl</Name>
        <Section>1</Section>
        <Text>Group Page Counts</Text>
        <Top>200</Top>
        <Width>9360</Width>
        <Height>600</Height>
        <Align>6</Align>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>18</Size>
        </Font>
      </Field>
      <Field>
        <Name>Field1</Name>
        <Section>1</Section>
        <Text>"Sales from " &amp; Min(ShippedDate) &amp; " to " &amp; Max(ShippedDate)</Text>
        <Calculated>-1</Calculated>
        <Top>3900</Top>
        <Width>9270</Width>
        <Height>360</Height>
        <Align>6</Align>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>Country</Name>
        <Section>5</Section>
        <Text>Country</Text>
        <Calculated>-1</Calculated>
        <Left>1125</Left>
        <Top>60</Top>
        <Width>2820</Width>
        <Height>330</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>12</Size>
        </Font>
      </Field>
      <Field>
        <Name>CountryLabel</Name>
        <Section>5</Section>
        <Text>Country:</Text>
        <Top>60</Top>
        <Width>1095</Width>
        <Height>330</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>12</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line1</Name>
        <Section>5</Section>
        <Top>465</Top>
        <Width>9346</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>40</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Salesperson</Name>
        <Section>7</Section>
        <Text>=[LastName] &amp; ", " &amp; [FirstName]</Text>
        <Calculated>-1</Calculated>
        <Left>1470</Left>
        <Top>75</Top>
        <Width>3030</Width>
        <Height>285</Height>
        <Font>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>SalespersonLabel</Name>
        <Section>7</Section>
        <Text>Salesperson:</Text>
        <Top>75</Top>
        <Width>1410</Width>
        <Height>285</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>OrderIDLabel</Name>
        <Section>7</Section>
        <Text>Order ID:</Text>
        <Left>1410</Left>
        <Top>1125</Top>
        <Width>945</Width>
        <Height>285</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>SalesAmountLabel</Name>
        <Section>7</Section>
        <Text>Sale Amount:</Text>
        <Left>2688</Left>
        <Top>1125</Top>
        <Width>1365</Width>
        <Height>285</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>ExceededGoalLabel</Name>
        <Section>7</Section>
        <Text>"Exceeded " &amp; Format([Sales Goal], "#,##0") &amp; " Sales Goal!"</Text>
        <Calculated>-1</Calculated>
        <Left>15</Left>
        <Top>495</Top>
        <Width>4905</Width>
        <Height>285</Height>
        <ForeColor>255</ForeColor>
        <CanShrink>-1</CanShrink>
        <Font>
          <Bold>-1</Bold>
          <Italic>-1</Italic>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>SalespersonLine1</Name>
        <Section>7</Section>
        <Top>450</Top>
        <Width>6180</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>255</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>PercentOfSalespersonTotalLabel</Name>
        <Section>7</Section>
        <Text>Percent of
Salesperson's Total:</Text>
        <Left>4338</Left>
        <Top>900</Top>
        <Width>2010</Width>
        <Height>525</Height>
        <Align>1</Align>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>PercentOfCountryTotalLabel</Name>
        <Section>7</Section>
        <Text>Percent of
 Country Total:</Text>
        <Left>6618</Left>
        <Top>900</Top>
        <Width>1485</Width>
        <Height>525</Height>
        <Align>1</Align>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line2</Name>
        <Section>7</Section>
        <Left>1410</Left>
        <Top>1470</Top>
        <Width>7425</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line3</Name>
        <Section>7</Section>
        <Left>1410</Left>
        <Top>1515</Top>
        <Width>7425</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line4</Name>
        <Section>7</Section>
        <Left>1410</Left>
        <Top>825</Top>
        <Width>7425</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line5</Name>
        <Section>7</Section>
        <Left>1410</Left>
        <Top>870</Top>
        <Width>7425</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>OrderID</Name>
        <Section>0</Section>
        <Text>OrderID</Text>
        <Calculated>-1</Calculated>
        <Left>1491</Left>
        <Width>570</Width>
        <Height>255</Height>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>SaleAmount</Name>
        <Section>0</Section>
        <Text>SaleAmount</Text>
        <Calculated>-1</Calculated>
        <Format>Currency</Format>
        <Left>2790</Left>
        <Width>1005</Width>
        <Height>255</Height>
        <Align>2</Align>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>PercentOfSalespersonTotal</Name>
        <Section>0</Section>
        <Text>=[SaleAmount]/[SalespersonTotal]</Text>
        <Calculated>-1</Calculated>
        <Format>Percent</Format>
        <Left>4785</Left>
        <Width>915</Width>
        <Height>255</Height>
        <Align>2</Align>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>PercentOfCountryTotal</Name>
        <Section>0</Section>
        <Text>=[SaleAmount]/[CountryTotal]</Text>
        <Calculated>-1</Calculated>
        <Format>Percent</Format>
        <Left>6660</Left>
        <Width>900</Width>
        <Height>255</Height>
        <Align>2</Align>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>SalespersonTotal</Name>
        <Section>8</Section>
        <Text>=Sum([SaleAmount])</Text>
        <Calculated>-1</Calculated>
        <Format>Currency</Format>
        <Left>2760</Left>
        <Top>240</Top>
        <Width>1140</Width>
        <Height>255</Height>
        <Align>2</Align>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>EmployeeTotalCaption</Name>
        <Section>8</Section>
        <Text>="Total for " &amp; [Salesperson] &amp; ":"</Text>
        <Calculated>-1</Calculated>
        <Top>240</Top>
        <Width>2670</Width>
        <Height>255</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line6</Name>
        <Section>8</Section>
        <Top>645</Top>
        <Width>8895</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line7</Name>
        <Section>8</Section>
        <Left>2865</Left>
        <Top>90</Top>
        <Width>1125</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line8</Name>
        <Section>8</Section>
        <Left>6765</Left>
        <Top>90</Top>
        <Width>990</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>PercentOfCountryTotal</Name>
        <Section>8</Section>
        <Text>=[SalespersonTotal]/[CountryTotal]</Text>
        <Calculated>-1</Calculated>
        <Format>Percent</Format>
        <Left>6765</Left>
        <Top>240</Top>
        <Width>900</Width>
        <Height>255</Height>
        <Align>2</Align>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>CountryTotalCaption</Name>
        <Section>6</Section>
        <Text>="Total for " &amp; [Country] &amp; ":"</Text>
        <Calculated>-1</Calculated>
        <Top>45</Top>
        <Width>2775</Width>
        <Height>255</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>CountryTotal</Name>
        <Section>6</Section>
        <Text>=Sum([SaleAmount])</Text>
        <Calculated>-1</Calculated>
        <Format>Currency</Format>
        <Left>2880</Left>
        <Top>60</Top>
        <Width>1440</Width>
        <Height>255</Height>
        <Align>2</Align>
      </Field>
      <Field>
        <Name>PercentOfGrandTotal</Name>
        <Section>6</Section>
        <Text>=[CountryTotal]/[GrandTotal]</Text>
        <Calculated>-1</Calculated>
        <Format>Percent</Format>
        <Left>2880</Left>
        <Top>495</Top>
        <Width>1440</Width>
        <Height>255</Height>
        <Align>2</Align>
      </Field>
      <Field>
        <Name>PercentOfGrandTotalLabel</Name>
        <Section>6</Section>
        <Text>="Percent " &amp; [Country] &amp; " is of Grand Total:"</Text>
        <Calculated>-1</Calculated>
        <Left>15</Left>
        <Top>480</Top>
        <Width>2805</Width>
        <Height>255</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line9</Name>
        <Section>6</Section>
        <Top>780</Top>
        <Width>9346</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <BorderColor>8421504</BorderColor>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>PageNumber1</Name>
        <Section>4</Section>
        <Text>=[Country] &amp; " -  " &amp; GroupPage(0) &amp; " of " &amp; GroupPages(0)</Text>
        <Calculated>-1</Calculated>
        <Left>3360</Left>
        <Top>75</Top>
        <Width>5835</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>DatePrinted1</Name>
        <Section>4</Section>
        <Text>=Format(Date(),"Medium Date")</Text>
        <Calculated>-1</Calculated>
        <Left>1035</Left>
        <Top>75</Top>
        <Width>1440</Width>
        <Height>285</Height>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>PrintedLabel1</Name>
        <Section>4</Section>
        <Text>Printed:</Text>
        <Left>45</Left>
        <Top>75</Top>
        <Width>900</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>GrandTotal</Name>
        <Section>2</Section>
        <Text>=Sum([SaleAmount])</Text>
        <Calculated>-1</Calculated>
        <Format>Currency</Format>
        <Left>2880</Left>
        <Top>150</Top>
        <Width>1440</Width>
        <Height>255</Height>
        <Align>2</Align>
      </Field>
      <Field>
        <Name>GrandTotalLabel</Name>
        <Section>2</Section>
        <Text>Grand Total:</Text>
        <Left>150</Left>
        <Top>135</Top>
        <Width>2505</Width>
        <Height>255</Height>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line10</Name>
        <Section>2</Section>
        <Left>2880</Left>
        <Top>450</Top>
        <Width>1530</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Line11</Name>
        <Section>2</Section>
        <Left>2880</Left>
        <Top>510</Top>
        <Width>1530</Width>
        <BorderStyle>1</BorderStyle>
        <LineWidth>20</LineWidth>
        <LineSlant>1</LineSlant>
        <Font>
          <Name>Microsoft Sans Serif</Name>
          <Size>9</Size>
        </Font>
      </Field>
      <Field>
        <Name>Group1Counter</Name>
        <Section>7</Section>
        <Text>"Page " &amp; GroupPage(1) &amp; " of " &amp; GroupPages(1) &amp; " for " &amp; LastName</Text>
        <Calculated>-1</Calculated>
        <Left>6210</Left>
        <Top>15</Top>
        <Width>2970</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>8388608</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>Group1Counter</Name>
        <Section>5</Section>
        <Text>"Page " &amp; GroupPage(0) &amp; " of " &amp; GroupPages(0) &amp; " for " &amp; Country</Text>
        <Calculated>-1</Calculated>
        <Left>4425</Left>
        <Top>90</Top>
        <Width>4755</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>8388608</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>Field2</Name>
        <Section>1</Section>
        <Text>This report shows how to include page numbers and counts for grouped reports.

C1Report always had two report variables for the current and total number of pages in the report (Page and Pages).

In Version 196, we added two script functions that return the current and total number of pages for the current group. The functions are called GroupPage(g) and GroupPages(g). The "g" parameter specifies which group to use, and can be either an index or the group name.

In the report below, the drag blue fields contain expressions like
    "Page " &amp; GroupPage(0) &amp; " of " &amp; GroupPages(0)

These expressions show the current page within the first group (index zero) and the total number of pages for each instance of the first group (in this example, there are two instances of the first group: UK and USA).</Text>
        <Left>60</Left>
        <Top>840</Top>
        <Width>9195</Width>
        <Height>2880</Height>
        <ForeColor>16777215</ForeColor>
        <CanGrow>-1</CanGrow>
        <Font>
          <Name>Verdana</Name>
          <Size>8.25</Size>
        </Font>
      </Field>
      <Field>
        <Name>Group1Counter1</Name>
        <Section>6</Section>
        <Text>"Page " &amp; GroupPage(0) &amp; " of " &amp; GroupPages(0) &amp; " for " &amp; Country</Text>
        <Calculated>-1</Calculated>
        <Left>4500</Left>
        <Top>60</Top>
        <Width>4755</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>8388608</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
      <Field>
        <Name>PageNumber2</Name>
        <Section>4</Section>
        <Text>"Report - " &amp; Page &amp; " of " &amp; Pages</Text>
        <Calculated>-1</Calculated>
        <Left>3360</Left>
        <Top>465</Top>
        <Width>5835</Width>
        <Height>285</Height>
        <Align>2</Align>
        <ForeColor>16777215</ForeColor>
        <Font>
          <Bold>-1</Bold>
          <Name>Verdana</Name>
          <Size>9.75</Size>
        </Font>
      </Field>
    </Fields>
  </Report>
</Reports>