<?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>38ed669d-1480-42c9-a131-3541eb1020c1</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>2.5cm</RightMargin>
  <LeftMargin>2.5cm</LeftMargin>
  <BottomMargin>2.5cm</BottomMargin>
  <rd:ReportID>d0a91cad-1242-460b-89c7-3902955a12fb</rd:ReportID>
  <PageWidth>21cm</PageWidth>
  <DataSets>
    <DataSet Name="Kontakty">
      <Fields>
        <Field Name="rok1">
          <DataField>rok1</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="kk">
          <DataField>kk</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="kr">
          <DataField>kr</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
      </Fields>
      <Query>
        <DataSourceName>BAZA_REKLAM</DataSourceName>
        <CommandText>select rok1, kk, kr  from 
(select year(data) as rok1, count(distinct customerId) as kk from dbo.KONTAKTY 
where year(data) &gt;=2005 group by year(data) )  t1
left join
(select year([FAKTURA DATA WYSTAWIENIA]) as rok2, count(distinct customerId) as kr
from dbo.reklama 
where year([FAKTURA DATA WYSTAWIENIA]) &gt;= 2005 
AND TYP ='PŁATNA'
group by year([FAKTURA DATA WYSTAWIENIA]),typ )  t2
 on t1.rok1 = t2.rok2 order by rok1 desc</CommandText>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
      </Query>
    </DataSet>
    <DataSet Name="Kontakty2">
      <Fields>
        <Field Name="rok">
          <DataField>rok</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="liczba">
          <DataField>liczba</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="liczba_klientow">
          <DataField>liczba_klientow</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="liczba_kontaktow">
          <DataField>liczba_kontaktow</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
      </Fields>
      <Query>
        <DataSourceName>BAZA_REKLAM</DataSourceName>
        <CommandText>select rok, liczba, count(customerId) as liczba_klientow, sum(liczba_kontaktow) as liczba_kontaktow from
(
select customerId, rok, sum(liczba) as liczba, liczba_kontaktow from (
select distinct customerId, tytuł, year([FAKTURA DATA WYSTAWIENIA])as rok,5 as liczba  from reklama 
where (tytuł='adMot') and year([FAKTURA DATA WYSTAWIENIA])&gt;=2005
union
select distinct customerId, tytuł, year([FAKTURA DATA WYSTAWIENIA]) as rok,3 as liczba  from reklama 
where (tytuł='GS') and year([FAKTURA DATA WYSTAWIENIA])&gt;=2005
union
select distinct customerId, tytuł, year([FAKTURA DATA WYSTAWIENIA]) as rok,1 as liczba from reklama 
where (tytuł='AMT') and year([FAKTURA DATA WYSTAWIENIA])&gt;=2005
) t1 left join 
 (select count(*) as liczba_kontaktow, customerId as custId, year(data) as rok1  from dbo.KONTAKTY 
where year(data) &gt;=2005 group by customerId, year(data) ) t2
on t1.customerId = t2.custId and t1.rok = t2.rok1
 group by rok, customerId, liczba_kontaktow  
) t3
group by rok, liczba order by rok desc, liczba</CommandText>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
      </Query>
    </DataSet>
    <DataSet Name="Kontakty3">
      <Fields>
        <Field Name="d1">
          <DataField>d1</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="c1">
          <DataField>c1</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="c2">
          <DataField>c2</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="c3">
          <DataField>c3</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
      </Fields>
      <Query>
        <DataSourceName>BAZA_REKLAM</DataSourceName>
        <CommandText>select d1,c1,c2,c3 from (
(select count( distinct customerID) as c1, year(data) as d1  from dbo.KONTAKTY where  opis like '%G*%' group by year(data)) t1
left join
(select count( distinct customerID) as c2, year(data) as d2 from dbo.KONTAKTY where  opis like '%T*%' group by year(data)) t2
on t1.d1=t2.d2
left join
(select count( distinct customerID) as c3, year(data) as d3 from dbo.KONTAKTY group by year(data)) t3 
on t2.d2=t3.d3 )
order by d1 desc</CommandText>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
      </Query>
    </DataSet>
  </DataSets>
  <Width>16.5cm</Width>
  <Body>
    <ColumnSpacing>1cm</ColumnSpacing>
    <ReportItems>
      <Chart Name="chart2">
        <Legend>
          <Visible>true</Visible>
          <Style>
            <BorderStyle>
              <Default>Solid</Default>
            </BorderStyle>
          </Style>
          <Position>BottomCenter</Position>
        </Legend>
        <CategoryAxis>
          <Axis>
            <Title />
            <MajorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MajorGridLines>
            <MinorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MinorGridLines>
            <MajorTickMarks>Inside</MajorTickMarks>
            <Min>0</Min>
            <Visible>true</Visible>
          </Axis>
        </CategoryAxis>
        <ZIndex>2</ZIndex>
        <DataSetName>Kontakty3</DataSetName>
        <PlotArea>
          <Style>
            <BackgroundColor>LightGrey</BackgroundColor>
            <BorderStyle>
              <Default>Solid</Default>
            </BorderStyle>
          </Style>
        </PlotArea>
        <ThreeDProperties>
          <Enabled>true</Enabled>
          <Shading>Real</Shading>
          <DrawingStyle>Cylinder</DrawingStyle>
        </ThreeDProperties>
        <PointWidth>0</PointWidth>
        <SeriesGroupings>
          <SeriesGrouping>
            <StaticSeries>
              <StaticMember>
                <Label>liczba klientów z którymi był kontakt w sprawie reklamy w GS</Label>
              </StaticMember>
              <StaticMember>
                <Label>liczba klientów z którymi był kontakt w sprawie reklamy w AMT</Label>
              </StaticMember>
              <StaticMember>
                <Label>liczba klientów z którymi był kontakt w sprawie reklamy (wszystkie)</Label>
              </StaticMember>
            </StaticSeries>
          </SeriesGrouping>
        </SeriesGroupings>
        <Top>11.25cm</Top>
        <Subtype>Plain</Subtype>
        <ValueAxis>
          <Axis>
            <Title />
            <MajorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MajorGridLines>
            <MinorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MinorGridLines>
            <MajorTickMarks>Inside</MajorTickMarks>
            <Min>0</Min>
            <Margin>true</Margin>
            <Visible>true</Visible>
            <Scalar>true</Scalar>
          </Axis>
        </ValueAxis>
        <Type>Column</Type>
        <Width>16.25cm</Width>
        <CategoryGroupings>
          <CategoryGrouping>
            <DynamicCategories>
              <Grouping Name="chart2_CategoryGroup1">
                <GroupExpressions>
                  <GroupExpression>=Fields!d1.Value</GroupExpression>
                </GroupExpressions>
              </Grouping>
              <Label />
            </DynamicCategories>
          </CategoryGrouping>
        </CategoryGroupings>
        <Palette>Pastel</Palette>
        <ChartData>
          <ChartSeries>
            <DataPoints>
              <DataPoint>
                <DataValues>
                  <DataValue>
                    <Value>=Fields!c1.Value</Value>
                  </DataValue>
                </DataValues>
                <DataLabel>
                  <Value>=Fields!c1.Value</Value>
                  <Visible>true</Visible>
                </DataLabel>
                <Marker>
                  <Size>6pt</Size>
                </Marker>
              </DataPoint>
            </DataPoints>
          </ChartSeries>
          <ChartSeries>
            <DataPoints>
              <DataPoint>
                <DataValues>
                  <DataValue>
                    <Value>=Fields!c2.Value</Value>
                  </DataValue>
                </DataValues>
                <DataLabel>
                  <Value>=Fields!c2.Value</Value>
                  <Visible>true</Visible>
                </DataLabel>
                <Marker>
                  <Size>6pt</Size>
                </Marker>
              </DataPoint>
            </DataPoints>
          </ChartSeries>
          <ChartSeries>
            <DataPoints>
              <DataPoint>
                <DataValues>
                  <DataValue>
                    <Value>=Fields!c3.Value</Value>
                  </DataValue>
                </DataValues>
                <DataLabel>
                  <Value>=Fields!c3.Value</Value>
                  <Visible>true</Visible>
                </DataLabel>
                <Marker>
                  <Size>6pt</Size>
                </Marker>
              </DataPoint>
            </DataPoints>
          </ChartSeries>
        </ChartData>
        <Style>
          <BackgroundColor>White</BackgroundColor>
        </Style>
        <Title>
          <Caption>Analiza klientów 2</Caption>
        </Title>
        <Height>11.25cm</Height>
      </Chart>
      <List Name="list1">
        <ZIndex>1</ZIndex>
        <DataSetName>Kontakty2</DataSetName>
        <ReportItems>
          <Textbox Name="rok">
            <rd:DefaultName>rok</rd:DefaultName>
            <Width>15cm</Width>
            <Style>
              <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>=Fields!rok.Value</Value>
          </Textbox>
          <Table Name="table1">
            <DataSetName>Kontakty2</DataSetName>
            <Top>0.75cm</Top>
            <Width>15.08334cm</Width>
            <Details>
              <TableRows>
                <TableRow>
                  <TableCells>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="liczba">
                          <rd:DefaultName>liczba</rd:DefaultName>
                          <Style>
                            <BorderColor>
                              <Default>LightGrey</Default>
                            </BorderColor>
                            <BorderStyle>
                              <Default>Solid</Default>
                            </BorderStyle>
                            <BorderWidth>
                              <Default>0.5pt</Default>
                            </BorderWidth>
                            <TextAlign>Center</TextAlign>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <ZIndex>2</ZIndex>
                          <CanGrow>true</CanGrow>
                          <Value>=switch(Fields!liczba.Value = 1,"AMT", Fields!liczba.Value = 3,"GS", Fields!liczba.Value = 5,"adMoto",Fields!liczba.Value = 4,"AMT i GS", Fields!liczba.Value = 6,"AMT i adMoto",Fields!liczba.Value =8,"GS i adMoto", Fields!liczba.Value = 9,"AMT, GS, adMoto")</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="liczba_klientow">
                          <rd:DefaultName>liczba_klientow</rd:DefaultName>
                          <Style>
                            <BorderColor>
                              <Default>LightGrey</Default>
                            </BorderColor>
                            <BorderStyle>
                              <Default>Solid</Default>
                            </BorderStyle>
                            <BorderWidth>
                              <Default>0.5pt</Default>
                            </BorderWidth>
                            <TextAlign>Center</TextAlign>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <ZIndex>1</ZIndex>
                          <CanGrow>true</CanGrow>
                          <Value>=Fields!liczba_klientow.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="liczba_kontaktow">
                          <rd:DefaultName>liczba_kontaktow</rd:DefaultName>
                          <Style>
                            <BorderColor>
                              <Default>LightGrey</Default>
                            </BorderColor>
                            <BorderStyle>
                              <Default>Solid</Default>
                            </BorderStyle>
                            <BorderWidth>
                              <Default>0.5pt</Default>
                            </BorderWidth>
                            <TextAlign>Center</TextAlign>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <CanGrow>true</CanGrow>
                          <Value>=Fields!liczba_kontaktow.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                  </TableCells>
                  <Height>0.63492cm</Height>
                </TableRow>
              </TableRows>
            </Details>
            <Header>
              <TableRows>
                <TableRow>
                  <TableCells>
                    <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>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <ZIndex>5</ZIndex>
                          <CanGrow>true</CanGrow>
                          <Value>Tytuł</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>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <ZIndex>4</ZIndex>
                          <CanGrow>true</CanGrow>
                          <Value>Liczba klientów</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>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <PaddingBottom>2pt</PaddingBottom>
                          </Style>
                          <ZIndex>3</ZIndex>
                          <CanGrow>true</CanGrow>
                          <Value>Liczba kontaktów</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                  </TableCells>
                  <Height>0.63492cm</Height>
                </TableRow>
              </TableRows>
            </Header>
            <TableColumns>
              <TableColumn>
                <Width>4.25cm</Width>
              </TableColumn>
              <TableColumn>
                <Width>5.41667cm</Width>
              </TableColumn>
              <TableColumn>
                <Width>5.41667cm</Width>
              </TableColumn>
            </TableColumns>
            <Height>1.26984cm</Height>
            <Left>0.5cm</Left>
          </Table>
        </ReportItems>
        <Top>22.75cm</Top>
        <Width>16.25cm</Width>
        <Grouping Name="list1_Details_Group">
          <GroupExpressions>
            <GroupExpression>=Fields!rok.Value</GroupExpression>
          </GroupExpressions>
        </Grouping>
        <PageBreakAtStart>true</PageBreakAtStart>
      </List>
      <Chart Name="chart1">
        <Legend>
          <Visible>true</Visible>
          <Style>
            <BorderStyle>
              <Default>Solid</Default>
            </BorderStyle>
          </Style>
          <Position>BottomCenter</Position>
        </Legend>
        <CategoryAxis>
          <Axis>
            <Title />
            <MajorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MajorGridLines>
            <MinorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MinorGridLines>
            <MajorTickMarks>Inside</MajorTickMarks>
            <Min>0</Min>
            <Visible>true</Visible>
          </Axis>
        </CategoryAxis>
        <DataSetName>Kontakty</DataSetName>
        <PlotArea>
          <Style>
            <BackgroundColor>LightGrey</BackgroundColor>
            <BorderStyle>
              <Default>Solid</Default>
            </BorderStyle>
          </Style>
        </PlotArea>
        <ThreeDProperties>
          <Enabled>true</Enabled>
          <Shading>Real</Shading>
          <DrawingStyle>Cylinder</DrawingStyle>
        </ThreeDProperties>
        <PointWidth>0</PointWidth>
        <SeriesGroupings>
          <SeriesGrouping>
            <StaticSeries>
              <StaticMember>
                <Label>liczba klientów, z którymi był kontakt w danym roku </Label>
              </StaticMember>
              <StaticMember>
                <Label>liczba klientów, którzy kupili reklamę w danym roku</Label>
              </StaticMember>
            </StaticSeries>
          </SeriesGrouping>
        </SeriesGroupings>
        <Subtype>Plain</Subtype>
        <ValueAxis>
          <Axis>
            <Title />
            <MajorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MajorGridLines>
            <MinorGridLines>
              <Style>
                <BorderStyle>
                  <Default>Solid</Default>
                </BorderStyle>
              </Style>
            </MinorGridLines>
            <MajorTickMarks>Inside</MajorTickMarks>
            <Min>0</Min>
            <Margin>true</Margin>
            <Visible>true</Visible>
            <Scalar>true</Scalar>
          </Axis>
        </ValueAxis>
        <Type>Column</Type>
        <Width>16.25cm</Width>
        <CategoryGroupings>
          <CategoryGrouping>
            <DynamicCategories>
              <Grouping Name="chart1_CategoryGroup1">
                <GroupExpressions>
                  <GroupExpression>=Fields!rok1.Value</GroupExpression>
                </GroupExpressions>
              </Grouping>
              <Label />
            </DynamicCategories>
          </CategoryGrouping>
        </CategoryGroupings>
        <Palette>Pastel</Palette>
        <ChartData>
          <ChartSeries>
            <DataPoints>
              <DataPoint>
                <DataValues>
                  <DataValue>
                    <Value>=Fields!kk.Value</Value>
                  </DataValue>
                </DataValues>
                <DataLabel>
                  <Value>=Fields!kk.Value</Value>
                  <Position>Top</Position>
                  <Visible>true</Visible>
                </DataLabel>
                <Marker>
                  <Size>6pt</Size>
                </Marker>
              </DataPoint>
            </DataPoints>
          </ChartSeries>
          <ChartSeries>
            <DataPoints>
              <DataPoint>
                <DataValues>
                  <DataValue>
                    <Value>=Fields!kr.Value</Value>
                  </DataValue>
                </DataValues>
                <DataLabel>
                  <Value>=Fields!kr.Value</Value>
                  <Position>Top</Position>
                  <Visible>true</Visible>
                </DataLabel>
                <Marker>
                  <Size>6pt</Size>
                </Marker>
              </DataPoint>
            </DataPoints>
          </ChartSeries>
        </ChartData>
        <Style>
          <BackgroundColor>White</BackgroundColor>
        </Style>
        <Title>
          <Caption>Analiza klientów</Caption>
        </Title>
        <Height>11cm</Height>
      </Chart>
    </ReportItems>
    <Height>25cm</Height>
  </Body>
  <Language>en-US</Language>
  <TopMargin>2.5cm</TopMargin>
  <PageHeight>29.7cm</PageHeight>
</Report>