root/branches/Abonament/RaportySQL/WykresNettoIlosc3.rdl @ 779

Wersja 130, 19.1 KB (wprowadzona przez marek, 17 years temu)
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
3  <DataSources>
4    <DataSource Name="BAZA_REKLAM">
5      <rd:DataSourceID>6a2bec57-03d9-4f28-a49c-65e1805de702</rd:DataSourceID>
6      <DataSourceReference>BAZA_REKLAM</DataSourceReference>
7    </DataSource>
8  </DataSources>
9  <InteractiveHeight>29.7cm</InteractiveHeight>
10  <ReportParameters>
11    <ReportParameter Name="okres">
12      <DataType>String</DataType>
13      <DefaultValue>
14        <Values>
15          <Value>=Year(Today)-2</Value>
16        </Values>
17      </DefaultValue>
18      <AllowBlank>true</AllowBlank>
19      <Prompt>okres</Prompt>
20      <ValidValues>
21        <ParameterValues>
22          <ParameterValue>
23            <Value>2002</Value>
24            <Label>ROK</Label>
25          </ParameterValue>
26          <ParameterValue>
27            <Value>=Year(Today)-4</Value>
28            <Label>PÓŁROCZE</Label>
29          </ParameterValue>
30          <ParameterValue>
31            <Value>=Year(Today)-3</Value>
32            <Label>KWARTAŁ</Label>
33          </ParameterValue>
34          <ParameterValue>
35            <Value>=Year(Today)-2</Value>
36            <Label>MS</Label>
37          </ParameterValue>
38        </ParameterValues>
39      </ValidValues>
40    </ReportParameter>
41    <ReportParameter Name="tytul">
42      <DataType>String</DataType>
43      <Nullable>true</Nullable>
44      <Prompt>tytuł:</Prompt>
45      <ValidValues>
46        <DataSetReference>
47          <DataSetName>ListaTytulow</DataSetName>
48          <ValueField>value</ValueField>
49          <LabelField>label</LabelField>
50        </DataSetReference>
51      </ValidValues>
52    </ReportParameter>
53    <ReportParameter Name="agencja">
54      <DataType>String</DataType>
55      <Nullable>true</Nullable>
56      <Prompt>agencja</Prompt>
57      <ValidValues>
58        <DataSetReference>
59          <DataSetName>ListaAgencji</DataSetName>
60          <ValueField>Id_agencji</ValueField>
61          <LabelField>Symbol</LabelField>
62        </DataSetReference>
63      </ValidValues>
64    </ReportParameter>
65    <ReportParameter Name="agent">
66      <DataType>String</DataType>
67      <Nullable>true</Nullable>
68      <Prompt>agent</Prompt>
69      <ValidValues>
70        <DataSetReference>
71          <DataSetName>ListaAgentow</DataSetName>
72          <ValueField>ID_AGENTA</ValueField>
73          <LabelField>Symbol</LabelField>
74        </DataSetReference>
75      </ValidValues>
76    </ReportParameter>
77  </ReportParameters>
78  <rd:DrawGrid>true</rd:DrawGrid>
79  <InteractiveWidth>21cm</InteractiveWidth>
80  <rd:GridSpacing>0.25cm</rd:GridSpacing>
81  <rd:SnapToGrid>true</rd:SnapToGrid>
82  <RightMargin>1cm</RightMargin>
83  <LeftMargin>1cm</LeftMargin>
84  <BottomMargin>1cm</BottomMargin>
85  <rd:ReportID>58bc7198-b2fa-4939-89e9-e74e3118e4d0</rd:ReportID>
86  <PageWidth>29.7cm</PageWidth>
87  <DataSets>
88    <DataSet Name="wgDatyZaplaty_ZatwierdzoneDoDruku">
89      <Fields>
90        <Field Name="rok">
91          <DataField>ROK</DataField>
92          <rd:TypeName>System.Int32</rd:TypeName>
93        </Field>
94        <Field Name="rok_po">
95          <DataField>ROK_PO</DataField>
96          <rd:TypeName>System.Int32</rd:TypeName>
97        </Field>
98        <Field Name="kw">
99          <DataField>KW</DataField>
100          <rd:TypeName>System.Int32</rd:TypeName>
101        </Field>
102        <Field Name="ms">
103          <DataField>MS</DataField>
104          <rd:TypeName>System.Int32</rd:TypeName>
105        </Field>
106        <Field Name="netto">
107          <DataField>netto</DataField>
108          <rd:TypeName>System.Double</rd:TypeName>
109        </Field>
110        <Field Name="ilosc">
111          <DataField>ilosc</DataField>
112          <rd:TypeName>System.Int32</rd:TypeName>
113        </Field>
114        <Field Name="tytul">
115          <DataField>tytul</DataField>
116          <rd:TypeName>System.String</rd:TypeName>
117        </Field>
118        <Field Name="agencja">
119          <DataField>agencja</DataField>
120          <rd:TypeName>System.String</rd:TypeName>
121        </Field>
122        <Field Name="agent">
123          <DataField>agent</DataField>
124          <rd:TypeName>System.String</rd:TypeName>
125        </Field>
126      </Fields>
127      <Query>
128        <DataSourceName>BAZA_REKLAM</DataSourceName>
129        <CommandText>SELECT        ROK, ROK_PO, KW, MS, SUM(NETTO) AS netto, COUNT(ILOSC) AS ilosc, tytul, agencja, agent
130FROM            (
131SELECT
132ROUND(NETTO, 0) AS NETTO,
1331 AS ILOSC,
134DATEPART(YEAR, dbo.REKLAMA.[DATA ZAPŁATY]) AS ROK,
135 DATEPART(QUARTER, dbo.REKLAMA.[DATA ZAPŁATY]) AS KW,
136CONVERT(INTEGER,(1.0+DATEPART(QUARTER, dbo.REKLAMA.[DATA ZAPŁATY]))/2) AS ROK_PO,
137 DATEPART(MONTH, dbo.REKLAMA.[DATA ZAPŁATY]) AS MS,
138DATEPART(Week, dbo.REKLAMA.[DATA ZAPŁATY]) AS WW,
139dbo.REKLAMA.[DATA ZAPŁATY], REKLAMA.TYTUŁ AS tytul, Agencje.Symbol as agencja, Agenci.Symbol as agent FROM
140dbo.AGENCJE INNER JOIN dbo.AGENCI ON dbo.AGENCJE.Id_agencji = dbo.AGENCI.ID_AGENCJI
141INNER JOIN dbo.REKLAMA ON dbo.AGENCI.Symbol = dbo.REKLAMA.[SYMBOL AKWIZYTORA]
142INNER JOIN dbo.Klienci on dbo.Klienci.CustomerId = dbo.Reklama.CustomerId
143WHERE
144 (dbo.REKLAMA.TYP = 'PŁATNA' OR dbo.REKLAMA.TYP = 'BARTER')
145AND (abs(dbo.REKLAMA.[ZATWIERDZONO DO DRUKU]) = 1)  AND (dbo.REKLAMA.ZAPŁACONO = 1)
146AND (DATEPART(YEAR, dbo.REKLAMA.[DATA ZAPŁATY]) &gt;= @od)
147AND (@tytul is null OR  REKLAMA.TYTUŁ = @tytul)
148AND (@agencja is null OR Agencje.id_agencji = @agencja)
149AND (@agent is null OR  Agenci.ID_AGENTA = @agent)
150 ) AS R
151GROUP BY ROK, ROK_PO, KW, MS, tytul, agencja, agent
152ORDER BY ROK desc, KW desc, MS desc</CommandText>
153        <QueryParameters>
154          <QueryParameter Name="@od">
155            <Value>=Parameters!okres.Value</Value>
156          </QueryParameter>
157          <QueryParameter Name="@tytul">
158            <Value>=Parameters!tytul.Value</Value>
159          </QueryParameter>
160          <QueryParameter Name="@agencja">
161            <Value>=Parameters!agencja.Value</Value>
162          </QueryParameter>
163          <QueryParameter Name="@agent">
164            <Value>=Parameters!agent.Value</Value>
165          </QueryParameter>
166        </QueryParameters>
167        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
168      </Query>
169    </DataSet>
170    <DataSet Name="ListaAgencji">
171      <Fields>
172        <Field Name="Id_agencji">
173          <DataField>Id_agencji</DataField>
174          <rd:TypeName>System.Int32</rd:TypeName>
175        </Field>
176        <Field Name="Symbol">
177          <DataField>Symbol</DataField>
178          <rd:TypeName>System.String</rd:TypeName>
179        </Field>
180      </Fields>
181      <Query>
182        <DataSourceName>BAZA_REKLAM</DataSourceName>
183        <CommandText>SELECT Id_agencji, Symbol
184FROM AGENCJE where aktywna=1
185union
186select NULL ,'Wszystkie'
187order by Symbol</CommandText>
188        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
189      </Query>
190    </DataSet>
191    <DataSet Name="ListaAgentow">
192      <Fields>
193        <Field Name="ID_AGENTA">
194          <DataField>ID_AGENTA</DataField>
195          <rd:TypeName>System.Int32</rd:TypeName>
196        </Field>
197        <Field Name="Symbol">
198          <DataField>Symbol</DataField>
199          <rd:TypeName>System.String</rd:TypeName>
200        </Field>
201        <Field Name="agencja">
202          <DataField>agencja</DataField>
203          <rd:TypeName>System.String</rd:TypeName>
204        </Field>
205      </Fields>
206      <Query>
207        <DataSourceName>BAZA_REKLAM</DataSourceName>
208        <CommandText>SELECT A.ID_AGENTA, A.Symbol, A2.Symbol agencja
209FROM AGENCI A left join Agencje A2
210on A.ID_AGENCJI = A2.ID_Agencji
211where  (A2.ID_Agencji in (@agencja)) and a.aktywny=1
212union
213select NULL,'Wszyscy','costam'
214order by A.Symbol</CommandText>
215        <QueryParameters>
216          <QueryParameter Name="@agencja">
217            <Value>=Parameters!agencja.Value</Value>
218          </QueryParameter>
219        </QueryParameters>
220        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
221      </Query>
222    </DataSet>
223    <DataSet Name="ListaTytulow">
224      <Fields>
225        <Field Name="label">
226          <DataField>label</DataField>
227          <rd:TypeName>System.String</rd:TypeName>
228        </Field>
229        <Field Name="value">
230          <DataField>value</DataField>
231          <rd:TypeName>System.String</rd:TypeName>
232        </Field>
233      </Fields>
234      <Query>
235        <DataSourceName>BAZA_REKLAM</DataSourceName>
236        <CommandText>SELECT      SYMB as label,  SYMB as value
237FROM            [LISTA TYTUŁÓW] where st_aktywny = -1
238union
239select 'Wszystkie',NULL</CommandText>
240        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
241      </Query>
242    </DataSet>
243  </DataSets>
244  <Code>Public Shared Function Formatuj(ByVal Value As Integer) As String
245        Formatuj = Format(Value, "### ### ##0.## zł")
246End Function</Code>
247  <Width>27.25cm</Width>
248  <Body>
249    <ColumnSpacing>1cm</ColumnSpacing>
250    <ReportItems>
251      <Chart Name="chart7">
252        <Legend>
253          <Style>
254            <BorderStyle>
255              <Default>Solid</Default>
256            </BorderStyle>
257          </Style>
258          <Position>RightCenter</Position>
259        </Legend>
260        <CategoryAxis>
261          <Axis>
262            <Title />
263            <MajorGridLines>
264              <Style>
265                <BorderStyle>
266                  <Default>Solid</Default>
267                </BorderStyle>
268              </Style>
269            </MajorGridLines>
270            <MinorGridLines>
271              <Style>
272                <BorderStyle>
273                  <Default>Solid</Default>
274                </BorderStyle>
275              </Style>
276            </MinorGridLines>
277            <MajorTickMarks>Outside</MajorTickMarks>
278            <Min>0</Min>
279            <Margin>true</Margin>
280            <Visible>true</Visible>
281          </Axis>
282        </CategoryAxis>
283        <ZIndex>1</ZIndex>
284        <DataSetName>wgDatyZaplaty_ZatwierdzoneDoDruku</DataSetName>
285        <PlotArea>
286          <Style>
287            <BackgroundColor>White</BackgroundColor>
288          </Style>
289        </PlotArea>
290        <ThreeDProperties>
291          <Enabled>true</Enabled>
292          <ProjectionMode>Orthographic</ProjectionMode>
293          <Shading>Real</Shading>
294          <DrawingStyle>Cylinder</DrawingStyle>
295        </ThreeDProperties>
296        <PointWidth>0</PointWidth>
297        <SeriesGroupings>
298          <SeriesGrouping>
299            <StaticSeries>
300              <StaticMember>
301                <Label>Value1</Label>
302              </StaticMember>
303            </StaticSeries>
304          </SeriesGrouping>
305        </SeriesGroupings>
306        <Subtype>Plain</Subtype>
307        <ValueAxis>
308          <Axis>
309            <Title />
310            <MajorGridLines>
311              <Style>
312                <BorderStyle>
313                  <Default>Solid</Default>
314                </BorderStyle>
315              </Style>
316            </MajorGridLines>
317            <MinorGridLines>
318              <Style>
319                <BorderStyle>
320                  <Default>Solid</Default>
321                </BorderStyle>
322              </Style>
323            </MinorGridLines>
324            <MajorTickMarks>Inside</MajorTickMarks>
325            <MinorTickMarks>Inside</MinorTickMarks>
326            <Min>0</Min>
327            <Margin>true</Margin>
328            <Visible>true</Visible>
329            <Scalar>true</Scalar>
330          </Axis>
331        </ValueAxis>
332        <Type>Column</Type>
333        <CategoryGroupings>
334          <CategoryGrouping>
335            <DynamicCategories>
336              <Grouping Name="chart7_CategoryGroup1">
337                <GroupExpressions>
338                  <GroupExpression>=Fields!rok.Value</GroupExpression>
339                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE",Fields!rok_po.Value,Parameters!okres.Label="KWARTAŁ",Fields!rok_po.Value,Parameters!okres.Label="MS",Fields!rok_po.Value)</GroupExpression>
340                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ",Fields!kw.Value,Parameters!okres.Label="MS",Fields!kw.Value)</GroupExpression>
341                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ","",Parameters!okres.Label="MS",Fields!ms.Value)</GroupExpression>
342                </GroupExpressions>
343              </Grouping>
344              <Label>=switch(Parameters!okres.Label="ROK",Fields!rok.Value,Parameters!okres.Label="PÓŁROCZE",Fields!rok.Value &amp; "/" &amp; Fields!rok_po.Value,Parameters!okres.Label="KWARTAŁ",Fields!rok.Value &amp; "/" &amp; Fields!kw.Value,Parameters!okres.Label="MS",iif(Fields!ms.Value.ToString().Length = 1, Fields!rok.Value &amp; "/0" &amp;  Fields!ms.Value,Fields!rok.Value &amp; "/" &amp;  Fields!ms.Value))</Label>
345            </DynamicCategories>
346          </CategoryGrouping>
347        </CategoryGroupings>
348        <Palette>Excel</Palette>
349        <ChartData>
350          <ChartSeries>
351            <DataPoints>
352              <DataPoint>
353                <DataValues>
354                  <DataValue>
355                    <Value>=Sum(Fields!netto.Value)</Value>
356                  </DataValue>
357                </DataValues>
358                <DataLabel>
359                  <Style>
360                    <FontSize>8pt</FontSize>
361                  </Style>
362                  <Value>=Code.Formatuj(Sum(Fields!netto.Value))</Value>
363                  <Position>Top</Position>
364                  <Rotation>-90</Rotation>
365                  <Visible>true</Visible>
366                </DataLabel>
367                <Marker>
368                  <Size>6pt</Size>
369                </Marker>
370              </DataPoint>
371            </DataPoints>
372          </ChartSeries>
373        </ChartData>
374        <Style>
375          <BackgroundColor>White</BackgroundColor>
376        </Style>
377        <Title>
378          <Caption>NETTO - zapłacone (wg daty zapłaty)</Caption>
379        </Title>
380        <Height>9.25cm</Height>
381      </Chart>
382      <Chart Name="chart8">
383        <Legend>
384          <Style>
385            <BorderStyle>
386              <Default>Solid</Default>
387            </BorderStyle>
388          </Style>
389          <Position>RightCenter</Position>
390        </Legend>
391        <CategoryAxis>
392          <Axis>
393            <Title />
394            <MajorGridLines>
395              <Style>
396                <BorderStyle>
397                  <Default>Solid</Default>
398                </BorderStyle>
399              </Style>
400            </MajorGridLines>
401            <MinorGridLines>
402              <Style>
403                <BorderStyle>
404                  <Default>Solid</Default>
405                </BorderStyle>
406              </Style>
407            </MinorGridLines>
408            <MajorTickMarks>Outside</MajorTickMarks>
409            <Min>0</Min>
410            <Margin>true</Margin>
411            <Visible>true</Visible>
412          </Axis>
413        </CategoryAxis>
414        <DataSetName>wgDatyZaplaty_ZatwierdzoneDoDruku</DataSetName>
415        <PlotArea>
416          <Style>
417            <BackgroundColor>White</BackgroundColor>
418          </Style>
419        </PlotArea>
420        <ThreeDProperties>
421          <Enabled>true</Enabled>
422          <Shading>Real</Shading>
423          <DrawingStyle>Cylinder</DrawingStyle>
424        </ThreeDProperties>
425        <PointWidth>0</PointWidth>
426        <SeriesGroupings>
427          <SeriesGrouping>
428            <StaticSeries>
429              <StaticMember>
430                <Label>Value1</Label>
431              </StaticMember>
432            </StaticSeries>
433          </SeriesGrouping>
434        </SeriesGroupings>
435        <Top>9.5cm</Top>
436        <Subtype>Plain</Subtype>
437        <ValueAxis>
438          <Axis>
439            <Title />
440            <MajorGridLines>
441              <Style>
442                <BorderStyle>
443                  <Default>Solid</Default>
444                </BorderStyle>
445              </Style>
446            </MajorGridLines>
447            <MinorGridLines>
448              <Style>
449                <BorderStyle>
450                  <Default>Solid</Default>
451                </BorderStyle>
452              </Style>
453            </MinorGridLines>
454            <MajorTickMarks>Outside</MajorTickMarks>
455            <Min>0</Min>
456            <Margin>true</Margin>
457            <Visible>true</Visible>
458            <Scalar>true</Scalar>
459          </Axis>
460        </ValueAxis>
461        <Type>Column</Type>
462        <CategoryGroupings>
463          <CategoryGrouping>
464            <DynamicCategories>
465              <Grouping Name="chart8_CategoryGroup1">
466                <GroupExpressions>
467                  <GroupExpression>=Fields!rok.Value</GroupExpression>
468                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE",Fields!rok_po.Value,Parameters!okres.Label="KWARTAŁ",Fields!rok_po.Value,Parameters!okres.Label="MS",Fields!rok_po.Value)</GroupExpression>
469                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ",Fields!kw.Value,Parameters!okres.Label="MS",Fields!kw.Value)</GroupExpression>
470                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ","",Parameters!okres.Label="MS",Fields!ms.Value)</GroupExpression>
471                </GroupExpressions>
472              </Grouping>
473              <Label>=switch(Parameters!okres.Label="ROK",Fields!rok.Value,Parameters!okres.Label="PÓŁROCZE",Fields!rok.Value &amp; "/" &amp; Fields!rok_po.Value,Parameters!okres.Label="KWARTAŁ",Fields!rok.Value &amp; "/" &amp; Fields!kw.Value,Parameters!okres.Label="MS",iif(Fields!ms.Value.ToString().Length = 1, Fields!rok.Value &amp; "/0" &amp;  Fields!ms.Value,Fields!rok.Value &amp; "/" &amp;  Fields!ms.Value))</Label>
474            </DynamicCategories>
475          </CategoryGrouping>
476        </CategoryGroupings>
477        <Palette>Default</Palette>
478        <ChartData>
479          <ChartSeries>
480            <DataPoints>
481              <DataPoint>
482                <DataValues>
483                  <DataValue>
484                    <Value>=Sum(Fields!ilosc.Value)</Value>
485                  </DataValue>
486                </DataValues>
487                <DataLabel>
488                  <Style />
489                  <Value>=Sum(Fields!ilosc.Value)</Value>
490                  <Position>Top</Position>
491                  <Rotation>-90</Rotation>
492                  <Visible>true</Visible>
493                </DataLabel>
494                <Style>
495                  <BackgroundColor>Gold</BackgroundColor>
496                </Style>
497                <Marker>
498                  <Size>6pt</Size>
499                </Marker>
500              </DataPoint>
501            </DataPoints>
502          </ChartSeries>
503        </ChartData>
504        <Style>
505          <BackgroundColor>White</BackgroundColor>
506        </Style>
507        <Title>
508          <Caption>ILOŚĆ - zapłacone (wg daty zapłaty)</Caption>
509        </Title>
510      </Chart>
511    </ReportItems>
512    <Height>18.75cm</Height>
513  </Body>
514  <Language>en-US</Language>
515  <TopMargin>1cm</TopMargin>
516  <PageHeight>21cm</PageHeight>
517</Report>
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.