<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <DataSources>
    <DataSource Name="BAZA_REKLAM">
      <rd:DataSourceID>d5cd74ea-0203-4897-b23b-608b6e7c9ee7</rd:DataSourceID>
      <DataSourceReference>BAZA_REKLAM</DataSourceReference>
    </DataSource>
  </DataSources>
  <InteractiveHeight>29.7cm</InteractiveHeight>
  <rd:DrawGrid>true</rd:DrawGrid>
  <InteractiveWidth>21cm</InteractiveWidth>
  <rd:GridSpacing>0.25cm</rd:GridSpacing>
  <rd:SnapToGrid>true</rd:SnapToGrid>
  <RightMargin>1cm</RightMargin>
  <LeftMargin>1cm</LeftMargin>
  <BottomMargin>2.5cm</BottomMargin>
  <rd:ReportID>b9375294-f8e7-4520-8f81-374698915f18</rd:ReportID>
  <PageWidth>21cm</PageWidth>
  <DataSets>
    <DataSet Name="RankingAgentow">
      <Fields>
        <Field Name="symbol">
          <DataField>symbol</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="WARTOSC">
          <DataField>WARTOSC</DataField>
          <rd:TypeName>System.Decimal</rd:TypeName>
        </Field>
        <Field Name="ILOSC">
          <DataField>ILOSC</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="srednio">
          <DataField>srednio</DataField>
          <rd:TypeName>System.Decimal</rd:TypeName>
        </Field>
      </Fields>
      <Query>
        <DataSourceName>BAZA_REKLAM</DataSourceName>
        <CommandText>SELECT A.symbol, 
    CONVERT(money, SUM(FD.NETTO)) AS WARTOSC, 
    COUNT(distinct FD.id_faktury) AS ILOSC,
    CONVERT(money, SUM(FD.NETTO)) / COUNT(distinct FD.id_faktury) AS srednio
FROM dbo.FAKTURY F left join 
    FAKTURA_DETAILS FD on F.id_faktury = FD.id_faktury left join
	AGENCI A on F.numer_roz = A.f_roz
WHERE F.numer_rok &gt;=2009  and zaplata_data is not null 
GROUP BY A.[symbol]
order by 2 desc</CommandText>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
      </Query>
    </DataSet>
  </DataSets>
  <Code />
  <Width>19cm</Width>
  <Body>
    <ColumnSpacing>1cm</ColumnSpacing>
    <ReportItems>
      <Textbox Name="textbox6">
        <rd:DefaultName>textbox6</rd:DefaultName>
        <Top>1cm</Top>
        <Width>18cm</Width>
        <Style>
          <Color>Red</Color>
          <FontWeight>700</FontWeight>
          <TextAlign>Center</TextAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <ZIndex>2</ZIndex>
        <CanGrow>true</CanGrow>
        <Left>0.5cm</Left>
        <Height>0.63492cm</Height>
        <Value>Ranking na podstawie zapłaconych faktur od 2009 (nie uwzględnia korekt).</Value>
      </Textbox>
      <Textbox Name="textbox5">
        <Top>0.25cm</Top>
        <Width>18cm</Width>
        <Style>
          <FontSize>12pt</FontSize>
          <FontWeight>700</FontWeight>
          <TextAlign>Center</TextAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <ZIndex>1</ZIndex>
        <CanGrow>true</CanGrow>
        <Left>0.5cm</Left>
        <Height>0.63492cm</Height>
        <Value>RANKING AGENTÓW</Value>
      </Textbox>
      <Table Name="table1">
        <DataSetName>RankingAgentow</DataSetName>
        <Top>2cm</Top>
        <Width>18cm</Width>
        <Details>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="SYMBOL_AKWIZYTORA">
                      <rd:DefaultName>SYMBOL_AKWIZYTORA</rd:DefaultName>
                      <Style>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>3</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!symbol.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="WARTOSC">
                      <rd:DefaultName>WARTOSC</rd:DefaultName>
                      <Style>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <Format>C</Format>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                        <Language>pl</Language>
                      </Style>
                      <ZIndex>2</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!WARTOSC.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="ILOSC">
                      <rd:DefaultName>ILOSC</rd:DefaultName>
                      <Style>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>1</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!ILOSC.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="srednio">
                      <rd:DefaultName>srednio</rd:DefaultName>
                      <Style>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <Format>C</Format>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                        <Language>pl</Language>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!srednio.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.75cm</Height>
            </TableRow>
          </TableRows>
        </Details>
        <Header>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox1">
                      <rd:DefaultName>textbox1</rd:DefaultName>
                      <Style>
                        <BackgroundColor>WhiteSmoke</BackgroundColor>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>7</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>Agent</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox2">
                      <rd:DefaultName>textbox2</rd:DefaultName>
                      <Style>
                        <BackgroundColor>WhiteSmoke</BackgroundColor>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>6</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>Wartość</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox3">
                      <rd:DefaultName>textbox3</rd:DefaultName>
                      <Style>
                        <BackgroundColor>WhiteSmoke</BackgroundColor>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>5</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>Ilość</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox4">
                      <rd:DefaultName>textbox4</rd:DefaultName>
                      <Style>
                        <BackgroundColor>WhiteSmoke</BackgroundColor>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <BorderWidth>
                          <Default>0.5pt</Default>
                        </BorderWidth>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Center</TextAlign>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>4</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>Średnio</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.75cm</Height>
            </TableRow>
          </TableRows>
        </Header>
        <TableColumns>
          <TableColumn>
            <Width>5.25cm</Width>
          </TableColumn>
          <TableColumn>
            <Width>5cm</Width>
          </TableColumn>
          <TableColumn>
            <Width>3.25cm</Width>
          </TableColumn>
          <TableColumn>
            <Width>4.5cm</Width>
          </TableColumn>
        </TableColumns>
        <Left>0.5cm</Left>
      </Table>
    </ReportItems>
    <Height>3.5cm</Height>
  </Body>
  <Language>en-US</Language>
  <TopMargin>2.5cm</TopMargin>
  <PageHeight>29.7cm</PageHeight>
</Report>