Pokaż
Ignoruj:
Data:
2010-01-12 11:05:23 (16 years ago)
Autor:
Sylwek
Opis:

Re #241

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/RaportySQL/BrakKontaktu.rdl

    r130 r1000  
    2323    <ReportParameter Name="agencja"> 
    2424      <DataType>Integer</DataType> 
     25      <Nullable>true</Nullable> 
    2526      <DefaultValue> 
    2627        <DataSetReference> 
     
    3940    </ReportParameter> 
    4041    <ReportParameter Name="agent"> 
    41       <DataType>String</DataType> 
     42      <DataType>Integer</DataType> 
     43      <Nullable>true</Nullable> 
    4244      <DefaultValue> 
    4345        <DataSetReference> 
    4446          <DataSetName>ListaAgentow</DataSetName> 
    45           <ValueField>Symbol</ValueField> 
     47          <ValueField>ID_AGENTA</ValueField> 
    4648        </DataSetReference> 
    4749      </DefaultValue> 
     50      <AllowBlank>true</AllowBlank> 
    4851      <Prompt>agent</Prompt> 
    4952      <ValidValues> 
    5053        <DataSetReference> 
    5154          <DataSetName>ListaAgentow</DataSetName> 
    52           <ValueField>Symbol</ValueField> 
     55          <ValueField>ID_AGENTA</ValueField> 
    5356          <LabelField>Symbol</LabelField> 
    5457        </DataSetReference> 
     
    6366      </DefaultValue> 
    6467      <Prompt>liczba dni</Prompt> 
     68    </ReportParameter> 
     69    <ReportParameter Name="country"> 
     70      <DataType>String</DataType> 
     71      <DefaultValue> 
     72        <DataSetReference> 
     73          <DataSetName>CountryList</DataSetName> 
     74          <ValueField>Country</ValueField> 
     75        </DataSetReference> 
     76      </DefaultValue> 
     77      <AllowBlank>true</AllowBlank> 
     78      <Prompt>Państwo</Prompt> 
     79      <ValidValues> 
     80        <DataSetReference> 
     81          <DataSetName>CountryList</DataSetName> 
     82          <ValueField>Country</ValueField> 
     83          <LabelField>Country</LabelField> 
     84        </DataSetReference> 
     85      </ValidValues> 
    6586    </ReportParameter> 
    6687  </ReportParameters> 
     
    88109      <Query> 
    89110        <DataSourceName>BAZA_REKLAM</DataSourceName> 
    90         <CommandText>SELECT        Id_agencji, Symbol 
    91 FROM            AGENCJE where aktywna=1 and (@prawa_agencje is null or @prawa_agencje= Id_agencji)</CommandText> 
     111        <CommandText>SELECT 0 AS Id_agencji, 'Wszystkie' AS Symbol WHERE @prawa_agencje IS NULL 
     112UNION 
     113SELECT        Id_agencji, Symbol 
     114FROM            AGENCJE  
     115WHERE   aktywna=1 and (@prawa_agencje IS NULL or @prawa_agencje= Id_agencji)</CommandText> 
    92116        <QueryParameters> 
    93117          <QueryParameter Name="@prawa_agencje"> 
     
    109133        </Field> 
    110134        <Field Name="agencja"> 
    111           <DataField>agencja</DataField> 
     135          <DataField>Agencja</DataField> 
    112136          <rd:TypeName>System.String</rd:TypeName> 
    113137        </Field> 
     
    115139      <Query> 
    116140        <DataSourceName>BAZA_REKLAM</DataSourceName> 
    117         <CommandText>SELECT        A.ID_AGENTA, A.Symbol, A2.Symbol agencja 
     141        <CommandText>SELECT 0 AS ID_AGENTA, 'Wszyscy' AS Symbol, 'Wszystkie' AS Agencja 
     142WHERE @prawa_agent IS NULL OR @prawa_agent = '' 
     143UNION 
     144SELECT        A.ID_AGENTA, A.Symbol, A2.Symbol agencja 
    118145FROM            AGENCI A left join Agencje A2 
    119146on A.ID_AGENCJI = A2.ID_Agencji 
    120  where aktywny=1 AND  (A2.ID_AGENCJI = @agencja OR @agencja is null) AND (@prawa_agent is null OR A.Symbol=@prawa_agent) 
     147 WHERE aktywny=1 AND  (A2.ID_AGENCJI = @agencja OR @agencja is null) AND (@prawa_agent is null OR A.Symbol=@prawa_agent) 
    121148order by A.Symbol</CommandText> 
    122149        <QueryParameters> 
     
    133160    <DataSet Name="Klienci"> 
    134161      <Fields> 
     162        <Field Name="Country"> 
     163          <DataField>Country</DataField> 
     164          <rd:TypeName>System.String</rd:TypeName> 
     165        </Field> 
    135166        <Field Name="Symbol"> 
    136167          <DataField>Symbol</DataField> 
    137168          <rd:TypeName>System.String</rd:TypeName> 
    138169        </Field> 
     170        <Field Name="Id_agencji"> 
     171          <DataField>Id_agencji</DataField> 
     172          <rd:TypeName>System.Int32</rd:TypeName> 
     173        </Field> 
    139174        <Field Name="FirstName"> 
    140175          <DataField>FirstName</DataField> 
     
    184219      <Query> 
    185220        <DataSourceName>BAZA_REKLAM</DataSourceName> 
    186         <CommandText>select A.Symbol , K.FirstName,K.City,K.PhoneNumber, K.NIP, K.aktywny, max(K2.data) as ostk, datediff(day,max(K2.data),getdate()) as ldni,KS.BRUTTO,KS.ZAPLATY,KS.ZALEGA,KS.ILOSC from KLIENCI K 
     221        <CommandText>SELECT TOP 1000 K.Country, A.Symbol, A.Id_agencji, K.FirstName,K.City,K.PhoneNumber, K.NIP, K.aktywny, max(K2.data) as ostk, datediff(day,max(K2.data),getdate()) as ldni,KS.BRUTTO,KS.ZAPLATY,KS.ZALEGA,KS.ILOSC 
     222FROM KLIENCI K 
    187223left join dbo.KONTAKTY K2 on K.CustomerId = K2.CustomerID  
    188224left join dbo.AGENCI A on K.UserName = A.Symbol  
    189225left join dbo.KLIENCI_SUMY_ZAPLAT KS on K.CustomerId = KS.CustomerID  
    190 group by A.Symbol , K.FirstName,K.City,K.PhoneNumber, K.NIP,K.aktywny, A.Id_agencji,KS.BRUTTO,KS.ZAPLATY,KS.ZALEGA,KS.ILOSC 
     226GROUP BY A.Symbol , K.FirstName,K.City,K.PhoneNumber, K.NIP,K.aktywny, A.Id_agencji,KS.BRUTTO,KS.ZAPLATY,KS.ZALEGA,KS.ILOSC, K.Country,  A.ID_AGENTA 
    191227HAVING datediff(day,max(K2.data),getdate()) &gt; @licznaDni 
    192 AND A.Id_agencji = @agencja order by KS.BRUTTO desc</CommandText> 
     228AND (A.Id_agencji = @agencja OR @agencja = 0) 
     229AND (K.Country = @country OR @country = '') 
     230AND (A.ID_AGENTA = @agent OR @agent = 0) 
     231ORDER BY KS.BRUTTO desc</CommandText> 
    193232        <QueryParameters> 
    194233          <QueryParameter Name="@licznaDni"> 
     
    198237            <Value>=Parameters!agencja.Value</Value> 
    199238          </QueryParameter> 
     239          <QueryParameter Name="@country"> 
     240            <Value>=Parameters!country.Value</Value> 
     241          </QueryParameter> 
     242          <QueryParameter Name="@agent"> 
     243            <Value>=Parameters!agent.Value</Value> 
     244          </QueryParameter> 
    200245        </QueryParameters> 
     246        <rd:UseGenericDesigner>true</rd:UseGenericDesigner> 
     247      </Query> 
     248    </DataSet> 
     249    <DataSet Name="CountryList"> 
     250      <Fields> 
     251        <Field Name="Country"> 
     252          <DataField>Country</DataField> 
     253          <rd:TypeName>System.String</rd:TypeName> 
     254        </Field> 
     255      </Fields> 
     256      <Query> 
     257        <DataSourceName>BAZA_REKLAM</DataSourceName> 
     258        <CommandText>SELECT '' AS Country 
     259UNION 
     260SELECT DISTINCT Country 
     261 FROM KLIENCI_SUMY_ZAPLAT 
     262 WHERE Country IS NOT NULL AND LTRIM(RTRIM(Country)) &lt;&gt; '' 
     263 ORDER BY Country</CommandText> 
    201264        <rd:UseGenericDesigner>true</rd:UseGenericDesigner> 
    202265      </Query> 
     
    204267  </DataSets> 
    205268  <Code /> 
    206   <Width>21.25cm</Width> 
     269  <Width>23.52646cm</Width> 
    207270  <Body> 
    208271    <ColumnSpacing>1cm</ColumnSpacing> 
     
    211274        <ZIndex>1</ZIndex> 
    212275        <DataSetName>Klienci</DataSetName> 
    213         <Filters> 
    214           <Filter> 
    215             <FilterExpression>=Fields!Symbol.Value</FilterExpression> 
    216             <Operator>Equal</Operator> 
    217             <FilterValues> 
    218               <FilterValue>=Parameters!agent.Value</FilterValue> 
    219             </FilterValues> 
    220           </Filter> 
    221         </Filters> 
    222276        <Top>1.25cm</Top> 
    223277        <Details> 
     
    246300                        <PaddingBottom>2pt</PaddingBottom> 
    247301                      </Style> 
     302                      <ZIndex>11</ZIndex> 
     303                      <CanGrow>true</CanGrow> 
     304                      <Value>=Fields!Symbol.Value</Value> 
     305                    </Textbox> 
     306                  </ReportItems> 
     307                </TableCell> 
     308                <TableCell> 
     309                  <ReportItems> 
     310                    <Textbox Name="Country"> 
     311                      <rd:DefaultName>Country</rd:DefaultName> 
     312                      <Style> 
     313                        <BorderColor> 
     314                          <Default>LightGrey</Default> 
     315                        </BorderColor> 
     316                        <BorderStyle> 
     317                          <Default>Solid</Default> 
     318                        </BorderStyle> 
     319                        <BorderWidth> 
     320                          <Default>0.5pt</Default> 
     321                        </BorderWidth> 
     322                        <FontSize>8pt</FontSize> 
     323                        <VerticalAlign>Middle</VerticalAlign> 
     324                        <PaddingLeft>2pt</PaddingLeft> 
     325                        <PaddingRight>2pt</PaddingRight> 
     326                        <PaddingTop>2pt</PaddingTop> 
     327                        <PaddingBottom>2pt</PaddingBottom> 
     328                      </Style> 
    248329                      <ZIndex>10</ZIndex> 
    249330                      <CanGrow>true</CanGrow> 
    250                       <Value>=Fields!Symbol.Value</Value> 
     331                      <Value>=Fields!Country.Value</Value> 
    251332                    </Textbox> 
    252333                  </ReportItems> 
     
    567648                        <PaddingBottom>2pt</PaddingBottom> 
    568649                      </Style> 
    569                       <ZIndex>21</ZIndex> 
     650                      <ZIndex>23</ZIndex> 
    570651                      <CanGrow>true</CanGrow> 
    571652                      <Value>Agent</Value> 
     653                    </Textbox> 
     654                  </ReportItems> 
     655                </TableCell> 
     656                <TableCell> 
     657                  <ReportItems> 
     658                    <Textbox Name="textbox7"> 
     659                      <rd:DefaultName>textbox7</rd:DefaultName> 
     660                      <Style> 
     661                        <BackgroundColor>WhiteSmoke</BackgroundColor> 
     662                        <BorderColor> 
     663                          <Default>LightGrey</Default> 
     664                        </BorderColor> 
     665                        <BorderStyle> 
     666                          <Default>Solid</Default> 
     667                        </BorderStyle> 
     668                        <BorderWidth> 
     669                          <Default>0.5pt</Default> 
     670                        </BorderWidth> 
     671                        <FontSize>8pt</FontSize> 
     672                        <FontWeight>700</FontWeight> 
     673                        <TextAlign>Center</TextAlign> 
     674                        <VerticalAlign>Middle</VerticalAlign> 
     675                        <PaddingLeft>2pt</PaddingLeft> 
     676                        <PaddingRight>2pt</PaddingRight> 
     677                        <PaddingTop>2pt</PaddingTop> 
     678                        <PaddingBottom>2pt</PaddingBottom> 
     679                      </Style> 
     680                      <ZIndex>22</ZIndex> 
     681                      <CanGrow>true</CanGrow> 
     682                      <Value>Państwo</Value> 
    572683                    </Textbox> 
    573684                  </ReportItems> 
     
    597708                        <PaddingBottom>2pt</PaddingBottom> 
    598709                      </Style> 
    599                       <ZIndex>20</ZIndex> 
     710                      <ZIndex>21</ZIndex> 
    600711                      <CanGrow>true</CanGrow> 
    601712                      <Value>Klient</Value> 
     
    627738                        <PaddingBottom>2pt</PaddingBottom> 
    628739                      </Style> 
    629                       <ZIndex>19</ZIndex> 
     740                      <ZIndex>20</ZIndex> 
    630741                      <CanGrow>true</CanGrow> 
    631742                      <Value>Miasto</Value> 
     
    657768                        <PaddingBottom>2pt</PaddingBottom> 
    658769                      </Style> 
    659                       <ZIndex>18</ZIndex> 
     770                      <ZIndex>19</ZIndex> 
    660771                      <CanGrow>true</CanGrow> 
    661772                      <Value>Telefon</Value> 
     
    687798                        <PaddingBottom>2pt</PaddingBottom> 
    688799                      </Style> 
    689                       <ZIndex>17</ZIndex> 
     800                      <ZIndex>18</ZIndex> 
    690801                      <CanGrow>true</CanGrow> 
    691802                      <Value>A</Value> 
     
    717828                        <PaddingBottom>2pt</PaddingBottom> 
    718829                      </Style> 
    719                       <ZIndex>16</ZIndex> 
     830                      <ZIndex>17</ZIndex> 
    720831                      <CanGrow>true</CanGrow> 
    721832                      <Value>Ostatni kontakt</Value> 
     
    747858                        <PaddingBottom>2pt</PaddingBottom> 
    748859                      </Style> 
    749                       <ZIndex>15</ZIndex> 
     860                      <ZIndex>16</ZIndex> 
    750861                      <CanGrow>true</CanGrow> 
    751862                      <Value>L. dni</Value> 
     
    777888                        <PaddingBottom>2pt</PaddingBottom> 
    778889                      </Style> 
    779                       <ZIndex>14</ZIndex> 
     890                      <ZIndex>15</ZIndex> 
    780891                      <CanGrow>true</CanGrow> 
    781892                      <Value>BRUTTO</Value> 
     
    807918                        <PaddingBottom>2pt</PaddingBottom> 
    808919                      </Style> 
    809                       <ZIndex>13</ZIndex> 
     920                      <ZIndex>14</ZIndex> 
    810921                      <CanGrow>true</CanGrow> 
    811922                      <Value>ZAPŁATY</Value> 
     
    837948                        <PaddingBottom>2pt</PaddingBottom> 
    838949                      </Style> 
    839                       <ZIndex>12</ZIndex> 
     950                      <ZIndex>13</ZIndex> 
    840951                      <CanGrow>true</CanGrow> 
    841952                      <Value>ZALEGA</Value> 
     
    867978                        <PaddingBottom>2pt</PaddingBottom> 
    868979                      </Style> 
    869                       <ZIndex>11</ZIndex> 
     980                      <ZIndex>12</ZIndex> 
    870981                      <CanGrow>true</CanGrow> 
    871982                      <Value>IL</Value> 
     
    883994          </TableColumn> 
    884995          <TableColumn> 
     996            <Width>2.25cm</Width> 
     997          </TableColumn> 
     998          <TableColumn> 
    885999            <Width>4.75cm</Width> 
    8861000          </TableColumn> 
     
    8981012          </TableColumn> 
    8991013          <TableColumn> 
    900             <Width>1cm</Width> 
     1014            <Width>1.02646cm</Width> 
    9011015          </TableColumn> 
    9021016          <TableColumn> 
     
    9161030      <Textbox Name="textbox32"> 
    9171031        <Top>0.25cm</Top> 
     1032        <Width>21.25cm</Width> 
    9181033        <Style> 
    9191034          <FontSize>12pt</FontSize>