Index: trunk/RaportySQL/SredniaCenaModulow.rdl
===================================================================
--- trunk/RaportySQL/SredniaCenaModulow.rdl (revision 577)
+++ trunk/RaportySQL/SredniaCenaModulow.rdl (revision 581)
@@ -7,5 +7,5 @@
     </DataSource>
   </DataSources>
-  <InteractiveHeight>11in</InteractiveHeight>
+  <InteractiveHeight>29.7cm</InteractiveHeight>
   <ReportParameters>
     <ReportParameter Name="year">
@@ -77,5 +77,5 @@
   </ReportParameters>
   <rd:DrawGrid>true</rd:DrawGrid>
-  <InteractiveWidth>8.5in</InteractiveWidth>
+  <InteractiveWidth>21cm</InteractiveWidth>
   <rd:GridSpacing>0.25cm</rd:GridSpacing>
   <rd:SnapToGrid>true</rd:SnapToGrid>
@@ -120,4 +120,8 @@
           <rd:TypeName>System.Decimal</rd:TypeName>
         </Field>
+        <Field Name="SumaNettoCennik">
+          <DataField>SumaNettoCennik</DataField>
+          <rd:TypeName>System.Decimal</rd:TypeName>
+        </Field>
       </Fields>
       <Query>
@@ -131,5 +135,6 @@
 COUNT(U.ID) AS IloscEmisji,
 CAST(SUM(((R.[Cena Jedn] - R.[Rabat Wartość]) * R.[Krotność]) / (R.Szer * R.Wys * R.[Krotność]))/Count(R.ReklamaId) AS DECIMAL(9,2)) AS Sprzedano, 
-CAST(SUM(M.Cena)/Count(R.ReklamaId) AS DECIMAL(9,2)) AS Cennik
+CAST(SUM(M.Cena)/Count(R.ReklamaId) AS DECIMAL(9,2)) AS Cennik,
+CAST(SUM(M.Cena * R.Szer * R.Wys) AS DECIMAL(9,2)) AS SumaNettoCennik
 FROM [ukaże się w nr] U
 INNER JOIN Reklama R ON R.ReklamaID = U.ReklamaID
@@ -186,5 +191,5 @@
   Return s
 End Function</Code>
-  <Width>19.73808cm</Width>
+  <Width>20.32936cm</Width>
   <Body>
     <ColumnSpacing>1cm</ColumnSpacing>
@@ -244,5 +249,5 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>20</ZIndex>
+                          <ZIndex>23</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value>=Fields!Agencja.Value</Value>
@@ -267,5 +272,5 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>19</ZIndex>
+                          <ZIndex>22</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value>
@@ -292,7 +297,31 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>18</ZIndex>
+                          <ZIndex>21</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value>=Sum(Fields!SumaNetto.Value)</Value>
+                        </Textbox>
+                      </ReportItems>
+                    </TableCell>
+                    <TableCell>
+                      <ReportItems>
+                        <Textbox Name="textbox29">
+                          <Style>
+                            <BorderColor>
+                              <Default>DarkGray</Default>
+                            </BorderColor>
+                            <BorderStyle>
+                              <Default>Solid</Default>
+                            </BorderStyle>
+                            <FontWeight>700</FontWeight>
+                            <Format>C</Format>
+                            <TextAlign>Center</TextAlign>
+                            <PaddingLeft>2pt</PaddingLeft>
+                            <PaddingRight>2pt</PaddingRight>
+                            <PaddingTop>2pt</PaddingTop>
+                            <PaddingBottom>2pt</PaddingBottom>
+                          </Style>
+                          <ZIndex>20</ZIndex>
+                          <CanGrow>true</CanGrow>
+                          <Value>=Sum(Fields!SumaNettoCennik.Value)</Value>
                         </Textbox>
                       </ReportItems>
@@ -315,5 +344,5 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>17</ZIndex>
+                          <ZIndex>19</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value>
@@ -339,5 +368,5 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>16</ZIndex>
+                          <ZIndex>18</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value />
@@ -362,5 +391,5 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>15</ZIndex>
+                          <ZIndex>17</ZIndex>
                           <CanGrow>true</CanGrow>
                           <Value />
@@ -379,4 +408,6 @@
                               <Default>Solid</Default>
                             </BorderStyle>
+                            <FontWeight>700</FontWeight>
+                            <Format>P</Format>
                             <TextAlign>Center</TextAlign>
                             <PaddingLeft>2pt</PaddingLeft>
@@ -385,7 +416,7 @@
                             <PaddingBottom>2pt</PaddingBottom>
                           </Style>
-                          <ZIndex>14</ZIndex>
+                          <ZIndex>16</ZIndex>
                           <CanGrow>true</CanGrow>
-                          <Value />
+                          <Value>=1- (Sum(Fields!SumaNetto.Value) / Sum(Fields!SumaNettoCennik.Value))</Value>
                         </Textbox>
                       </ReportItems>
@@ -412,5 +443,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>6</ZIndex>
+                      <ZIndex>7</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>
@@ -436,13 +467,36 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
+                      <ZIndex>6</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>=Fields!Agent.Value</Value>
+                    </Textbox>
+                  </ReportItems>
+                </TableCell>
+                <TableCell>
+                  <ReportItems>
+                    <Textbox Name="textbox16">
+                      <Style>
+                        <BorderColor>
+                          <Default>DarkGray</Default>
+                        </BorderColor>
+                        <BorderStyle>
+                          <Default>Solid</Default>
+                        </BorderStyle>
+                        <Format>C</Format>
+                        <TextAlign>Center</TextAlign>
+                        <PaddingLeft>2pt</PaddingLeft>
+                        <PaddingRight>2pt</PaddingRight>
+                        <PaddingTop>2pt</PaddingTop>
+                        <PaddingBottom>2pt</PaddingBottom>
+                      </Style>
                       <ZIndex>5</ZIndex>
                       <CanGrow>true</CanGrow>
-                      <Value>=Fields!Agent.Value</Value>
-                    </Textbox>
-                  </ReportItems>
-                </TableCell>
-                <TableCell>
-                  <ReportItems>
-                    <Textbox Name="textbox16">
+                      <Value>=Fields!SumaNetto.Value</Value>
+                    </Textbox>
+                  </ReportItems>
+                </TableCell>
+                <TableCell>
+                  <ReportItems>
+                    <Textbox Name="textbox26">
                       <Style>
                         <BorderColor>
@@ -461,5 +515,5 @@
                       <ZIndex>4</ZIndex>
                       <CanGrow>true</CanGrow>
-                      <Value>=Fields!SumaNetto.Value</Value>
+                      <Value>=Fields!SumaNettoCennik.Value</Value>
                     </Textbox>
                   </ReportItems>
@@ -590,5 +644,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>27</ZIndex>
+                      <ZIndex>31</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Agencja</Value>
@@ -615,5 +669,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>26</ZIndex>
+                      <ZIndex>30</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Agent</Value>
@@ -639,7 +693,32 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>25</ZIndex>
-                      <CanGrow>true</CanGrow>
-                      <Value>Suma Netto</Value>
+                      <ZIndex>29</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>Sprzedaż Netto</Value>
+                    </Textbox>
+                  </ReportItems>
+                </TableCell>
+                <TableCell>
+                  <ReportItems>
+                    <Textbox Name="textbox20">
+                      <rd:DefaultName>textbox20</rd:DefaultName>
+                      <Style>
+                        <BackgroundColor>WhiteSmoke</BackgroundColor>
+                        <BorderColor>
+                          <Default>DarkGray</Default>
+                        </BorderColor>
+                        <BorderStyle>
+                          <Default>Solid</Default>
+                        </BorderStyle>
+                        <FontWeight>700</FontWeight>
+                        <TextAlign>Center</TextAlign>
+                        <PaddingLeft>2pt</PaddingLeft>
+                        <PaddingRight>2pt</PaddingRight>
+                        <PaddingTop>2pt</PaddingTop>
+                        <PaddingBottom>2pt</PaddingBottom>
+                      </Style>
+                      <ZIndex>28</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>Sprzedaż wg cennika</Value>
                     </Textbox>
                   </ReportItems>
@@ -664,5 +743,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>24</ZIndex>
+                      <ZIndex>27</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Moduł</Value>
@@ -689,7 +768,7 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>23</ZIndex>
-                      <CanGrow>true</CanGrow>
-                      <Value>Cena sprzedaży</Value>
+                      <ZIndex>26</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>Średnia cena modułu</Value>
                     </Textbox>
                   </ReportItems>
@@ -714,7 +793,7 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>22</ZIndex>
-                      <CanGrow>true</CanGrow>
-                      <Value>Cena z cennika</Value>
+                      <ZIndex>25</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>Cena modułu z cennika</Value>
                     </Textbox>
                   </ReportItems>
@@ -739,5 +818,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>21</ZIndex>
+                      <ZIndex>24</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Rabat</Value>
@@ -753,5 +832,17 @@
         <TableColumns>
           <TableColumn>
-            <Width>4.5cm</Width>
+            <Width>4cm</Width>
+          </TableColumn>
+          <TableColumn>
+            <Width>2.5cm</Width>
+          </TableColumn>
+          <TableColumn>
+            <Width>2.5cm</Width>
+          </TableColumn>
+          <TableColumn>
+            <Width>2.5cm</Width>
+          </TableColumn>
+          <TableColumn>
+            <Width>2cm</Width>
           </TableColumn>
           <TableColumn>
@@ -762,14 +853,5 @@
           </TableColumn>
           <TableColumn>
-            <Width>2.53968cm</Width>
-          </TableColumn>
-          <TableColumn>
-            <Width>2.53968cm</Width>
-          </TableColumn>
-          <TableColumn>
-            <Width>2.53968cm</Width>
-          </TableColumn>
-          <TableColumn>
-            <Width>2.53968cm</Width>
+            <Width>1.75cm</Width>
           </TableColumn>
         </TableColumns>
@@ -788,5 +870,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>13</ZIndex>
+                      <ZIndex>15</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value />
@@ -804,5 +886,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>12</ZIndex>
+                      <ZIndex>14</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value />
@@ -828,7 +910,31 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>11</ZIndex>
+                      <ZIndex>13</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>=Sum(Fields!SumaNetto.Value)</Value>
+                    </Textbox>
+                  </ReportItems>
+                </TableCell>
+                <TableCell>
+                  <ReportItems>
+                    <Textbox Name="textbox27">
+                      <Style>
+                        <BorderColor>
+                          <Default>DarkGray</Default>
+                        </BorderColor>
+                        <BorderStyle>
+                          <Default>Solid</Default>
+                        </BorderStyle>
+                        <FontWeight>700</FontWeight>
+                        <Format>C</Format>
+                        <TextAlign>Center</TextAlign>
+                        <PaddingLeft>2pt</PaddingLeft>
+                        <PaddingRight>2pt</PaddingRight>
+                        <PaddingTop>2pt</PaddingTop>
+                        <PaddingBottom>2pt</PaddingBottom>
+                      </Style>
+                      <ZIndex>12</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value>=Sum(Fields!SumaNettoCennik.Value)</Value>
                     </Textbox>
                   </ReportItems>
@@ -844,5 +950,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>10</ZIndex>
+                      <ZIndex>11</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value />
@@ -860,5 +966,5 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
-                      <ZIndex>9</ZIndex>
+                      <ZIndex>10</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value />
@@ -876,23 +982,31 @@
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
+                      <ZIndex>9</ZIndex>
+                      <CanGrow>true</CanGrow>
+                      <Value />
+                    </Textbox>
+                  </ReportItems>
+                </TableCell>
+                <TableCell>
+                  <ReportItems>
+                    <Textbox Name="textbox28">
+                      <Style>
+                        <BorderColor>
+                          <Default>DarkGray</Default>
+                        </BorderColor>
+                        <BorderStyle>
+                          <Default>Solid</Default>
+                        </BorderStyle>
+                        <FontWeight>700</FontWeight>
+                        <Format>P</Format>
+                        <TextAlign>Center</TextAlign>
+                        <PaddingLeft>2pt</PaddingLeft>
+                        <PaddingRight>2pt</PaddingRight>
+                        <PaddingTop>2pt</PaddingTop>
+                        <PaddingBottom>2pt</PaddingBottom>
+                      </Style>
                       <ZIndex>8</ZIndex>
                       <CanGrow>true</CanGrow>
-                      <Value />
-                    </Textbox>
-                  </ReportItems>
-                </TableCell>
-                <TableCell>
-                  <ReportItems>
-                    <Textbox Name="textbox24">
-                      <rd:DefaultName>textbox24</rd:DefaultName>
-                      <Style>
-                        <PaddingLeft>2pt</PaddingLeft>
-                        <PaddingRight>2pt</PaddingRight>
-                        <PaddingTop>2pt</PaddingTop>
-                        <PaddingBottom>2pt</PaddingBottom>
-                      </Style>
-                      <ZIndex>7</ZIndex>
-                      <CanGrow>true</CanGrow>
-                      <Value />
+                      <Value>=1- (Sum(Fields!SumaNetto.Value) / Sum(Fields!SumaNettoCennik.Value))</Value>
                     </Textbox>
                   </ReportItems>
