root/trunk/RaportySQL/WykresNettoIlosc4_2009.rdl @ 190

Wersja 190, 19.0 KB (wprowadzona przez dorota, 17 years temu)

dodane raporty WykresNettoIlosc?2_2009, WykresNettoIlosc?3_2009, WykresNettoIlosc?4_2009

RevLine 
[190]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.Decimal</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.Int16</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(distinct reklamaId) AS ilosc, tytul, agencja, agent
130FROM         (SELECT ROUND(FD.NETTO, 0) AS NETTO,
131fd.reklamaId,
132year(faktury.data_wystawienia) AS ROK,
133DATEPART(QUARTER, faktury.data_wystawienia) AS KW,
134CONVERT(INTEGER,(1.0+DATEPART(QUARTER, faktury.data_wystawienia))/2) AS ROK_PO,
135month(faktury.data_wystawienia) AS MS,
136DATEPART(Week, faktury.data_wystawienia) AS WW,
137faktury.data_wystawienia, FD.tytul,  Agencje.Symbol as agencja, Agenci.Symbol as agent
138FROM
139dbo.AGENCJE INNER JOIN dbo.AGENCI ON dbo.AGENCJE.Id_agencji = dbo.AGENCI.ID_AGENCJI
140INNER JOIN dbo.FAKTURY ON dbo.AGENCI.F_ROZ = dbo.FAKTURY.[NUMER_ROZ]
141left join dbo.FAktura_details FD on FAKTURY.id_faktury= FD.id_faktury
142INNER JOIN dbo.Klienci on dbo.Klienci.CustomerId = dbo.Faktury.id_nabywcy
143WHERE  (DATEPART(YEAR, faktury.data_wystawienia) &gt;= @od)
144AND faktury.zaplata_data is not null
145AND (@tytul is null OR  FD.tytul = @tytul)
146AND (@agencja is null OR Agencje.id_agencji = @agencja)
147AND (@agent is null OR  Agenci.ID_AGENTA = @agent)) AS R
148GROUP BY ROK, ROK_PO, KW, MS, tytul, agencja, agent
149ORDER BY ROK DESC, KW DESC, MS DESC</CommandText>
150        <QueryParameters>
151          <QueryParameter Name="@od">
152            <Value>=Parameters!okres.Value</Value>
153          </QueryParameter>
154          <QueryParameter Name="@tytul">
155            <Value>=Parameters!tytul.Value</Value>
156          </QueryParameter>
157          <QueryParameter Name="@agencja">
158            <Value>=Parameters!agencja.Value</Value>
159          </QueryParameter>
160          <QueryParameter Name="@agent">
161            <Value>=Parameters!agent.Value</Value>
162          </QueryParameter>
163        </QueryParameters>
164        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
165      </Query>
166    </DataSet>
167    <DataSet Name="ListaAgencji">
168      <Fields>
169        <Field Name="Id_agencji">
170          <DataField>Id_agencji</DataField>
171          <rd:TypeName>System.Int32</rd:TypeName>
172        </Field>
173        <Field Name="Symbol">
174          <DataField>Symbol</DataField>
175          <rd:TypeName>System.String</rd:TypeName>
176        </Field>
177      </Fields>
178      <Query>
179        <DataSourceName>BAZA_REKLAM</DataSourceName>
180        <CommandText>SELECT Id_agencji, Symbol
181FROM AGENCJE where aktywna=1
182union
183select NULL ,'Wszystkie'
184order by Symbol</CommandText>
185        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
186      </Query>
187    </DataSet>
188    <DataSet Name="ListaAgentow">
189      <Fields>
190        <Field Name="ID_AGENTA">
191          <DataField>ID_AGENTA</DataField>
192          <rd:TypeName>System.Int32</rd:TypeName>
193        </Field>
194        <Field Name="Symbol">
195          <DataField>Symbol</DataField>
196          <rd:TypeName>System.String</rd:TypeName>
197        </Field>
198        <Field Name="agencja">
199          <DataField>agencja</DataField>
200          <rd:TypeName>System.String</rd:TypeName>
201        </Field>
202      </Fields>
203      <Query>
204        <DataSourceName>BAZA_REKLAM</DataSourceName>
205        <CommandText>SELECT A.ID_AGENTA, A.Symbol, A2.Symbol agencja
206FROM AGENCI A left join Agencje A2
207on A.ID_AGENCJI = A2.ID_Agencji
208where  (A2.ID_Agencji in (@agencja)) and a.aktywny=1
209union
210select NULL,'Wszyscy','costam'
211order by A.Symbol</CommandText>
212        <QueryParameters>
213          <QueryParameter Name="@agencja">
214            <Value>=Parameters!agencja.Value</Value>
215          </QueryParameter>
216        </QueryParameters>
217        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
218      </Query>
219    </DataSet>
220    <DataSet Name="ListaTytulow">
221      <Fields>
222        <Field Name="label">
223          <DataField>label</DataField>
224          <rd:TypeName>System.String</rd:TypeName>
225        </Field>
226        <Field Name="value">
227          <DataField>value</DataField>
228          <rd:TypeName>System.String</rd:TypeName>
229        </Field>
230      </Fields>
231      <Query>
232        <DataSourceName>BAZA_REKLAM</DataSourceName>
233        <CommandText>SELECT      SYMB as label,  SYMB as value
234FROM            [LISTA TYTUŁÓW] where st_aktywny = -1
235union
236select 'Wszystkie',NULL</CommandText>
237        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
238      </Query>
239    </DataSet>
240  </DataSets>
241  <Code>Public Shared Function Formatuj(ByVal Value As Integer) As String
242        Formatuj = Format(Value, "### ### ##0.## zł")
243End Function</Code>
244  <Width>27.25cm</Width>
245  <Body>
246    <ColumnSpacing>1cm</ColumnSpacing>
247    <ReportItems>
248      <Chart Name="chart7">
249        <Legend>
250          <Style>
251            <BorderStyle>
252              <Default>Solid</Default>
253            </BorderStyle>
254          </Style>
255          <Position>RightCenter</Position>
256        </Legend>
257        <CategoryAxis>
258          <Axis>
259            <Title />
260            <MajorGridLines>
261              <Style>
262                <BorderStyle>
263                  <Default>Solid</Default>
264                </BorderStyle>
265              </Style>
266            </MajorGridLines>
267            <MinorGridLines>
268              <Style>
269                <BorderStyle>
270                  <Default>Solid</Default>
271                </BorderStyle>
272              </Style>
273            </MinorGridLines>
274            <MajorTickMarks>Outside</MajorTickMarks>
275            <Min>0</Min>
276            <Margin>true</Margin>
277            <Visible>true</Visible>
278          </Axis>
279        </CategoryAxis>
280        <ZIndex>1</ZIndex>
281        <DataSetName>wgDatyZaplaty_ZatwierdzoneDoDruku</DataSetName>
282        <PlotArea>
283          <Style>
284            <BackgroundColor>White</BackgroundColor>
285          </Style>
286        </PlotArea>
287        <ThreeDProperties>
288          <Enabled>true</Enabled>
289          <ProjectionMode>Orthographic</ProjectionMode>
290          <Shading>Real</Shading>
291          <DrawingStyle>Cylinder</DrawingStyle>
292        </ThreeDProperties>
293        <PointWidth>0</PointWidth>
294        <SeriesGroupings>
295          <SeriesGrouping>
296            <StaticSeries>
297              <StaticMember>
298                <Label>Value1</Label>
299              </StaticMember>
300            </StaticSeries>
301          </SeriesGrouping>
302        </SeriesGroupings>
303        <Subtype>Plain</Subtype>
304        <ValueAxis>
305          <Axis>
306            <Title />
307            <MajorGridLines>
308              <Style>
309                <BorderStyle>
310                  <Default>Solid</Default>
311                </BorderStyle>
312              </Style>
313            </MajorGridLines>
314            <MinorGridLines>
315              <Style>
316                <BorderStyle>
317                  <Default>Solid</Default>
318                </BorderStyle>
319              </Style>
320            </MinorGridLines>
321            <MajorTickMarks>Inside</MajorTickMarks>
322            <MinorTickMarks>Inside</MinorTickMarks>
323            <Min>0</Min>
324            <Margin>true</Margin>
325            <Visible>true</Visible>
326            <Scalar>true</Scalar>
327          </Axis>
328        </ValueAxis>
329        <Type>Column</Type>
330        <CategoryGroupings>
331          <CategoryGrouping>
332            <DynamicCategories>
333              <Grouping Name="chart7_CategoryGroup1">
334                <GroupExpressions>
335                  <GroupExpression>=Fields!rok.Value</GroupExpression>
336                  <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>
337                  <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>
338                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ","",Parameters!okres.Label="MS",Fields!ms.Value)</GroupExpression>
339                </GroupExpressions>
340              </Grouping>
341              <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>
342            </DynamicCategories>
343          </CategoryGrouping>
344        </CategoryGroupings>
345        <Palette>Excel</Palette>
346        <ChartData>
347          <ChartSeries>
348            <DataPoints>
349              <DataPoint>
350                <DataValues>
351                  <DataValue>
352                    <Value>=Sum(Fields!netto.Value)</Value>
353                  </DataValue>
354                </DataValues>
355                <DataLabel>
356                  <Style>
357                    <FontSize>8pt</FontSize>
358                  </Style>
359                  <Value>=Code.Formatuj(Sum(Fields!netto.Value))</Value>
360                  <Position>Top</Position>
361                  <Rotation>-90</Rotation>
362                  <Visible>true</Visible>
363                </DataLabel>
364                <Marker>
365                  <Size>6pt</Size>
366                </Marker>
367              </DataPoint>
368            </DataPoints>
369          </ChartSeries>
370        </ChartData>
371        <Style>
372          <BackgroundColor>White</BackgroundColor>
373        </Style>
374        <Title>
375          <Caption>NETTO - zafakturowane (podział wg daty wystawienia faktury) i zapłacone</Caption>
376        </Title>
377        <Height>9.25cm</Height>
378      </Chart>
379      <Chart Name="chart8">
380        <Legend>
381          <Style>
382            <BorderStyle>
383              <Default>Solid</Default>
384            </BorderStyle>
385          </Style>
386          <Position>RightCenter</Position>
387        </Legend>
388        <CategoryAxis>
389          <Axis>
390            <Title />
391            <MajorGridLines>
392              <Style>
393                <BorderStyle>
394                  <Default>Solid</Default>
395                </BorderStyle>
396              </Style>
397            </MajorGridLines>
398            <MinorGridLines>
399              <Style>
400                <BorderStyle>
401                  <Default>Solid</Default>
402                </BorderStyle>
403              </Style>
404            </MinorGridLines>
405            <MajorTickMarks>Outside</MajorTickMarks>
406            <Min>0</Min>
407            <Margin>true</Margin>
408            <Visible>true</Visible>
409          </Axis>
410        </CategoryAxis>
411        <DataSetName>wgDatyZaplaty_ZatwierdzoneDoDruku</DataSetName>
412        <PlotArea>
413          <Style>
414            <BackgroundColor>White</BackgroundColor>
415          </Style>
416        </PlotArea>
417        <ThreeDProperties>
418          <Enabled>true</Enabled>
419          <Shading>Real</Shading>
420          <DrawingStyle>Cylinder</DrawingStyle>
421        </ThreeDProperties>
422        <PointWidth>0</PointWidth>
423        <SeriesGroupings>
424          <SeriesGrouping>
425            <StaticSeries>
426              <StaticMember>
427                <Label>Value1</Label>
428              </StaticMember>
429            </StaticSeries>
430          </SeriesGrouping>
431        </SeriesGroupings>
432        <Top>9.5cm</Top>
433        <Subtype>Plain</Subtype>
434        <ValueAxis>
435          <Axis>
436            <Title />
437            <MajorGridLines>
438              <Style>
439                <BorderStyle>
440                  <Default>Solid</Default>
441                </BorderStyle>
442              </Style>
443            </MajorGridLines>
444            <MinorGridLines>
445              <Style>
446                <BorderStyle>
447                  <Default>Solid</Default>
448                </BorderStyle>
449              </Style>
450            </MinorGridLines>
451            <MajorTickMarks>Outside</MajorTickMarks>
452            <Min>0</Min>
453            <Margin>true</Margin>
454            <Visible>true</Visible>
455            <Scalar>true</Scalar>
456          </Axis>
457        </ValueAxis>
458        <Type>Column</Type>
459        <CategoryGroupings>
460          <CategoryGrouping>
461            <DynamicCategories>
462              <Grouping Name="chart8_CategoryGroup1">
463                <GroupExpressions>
464                  <GroupExpression>=Fields!rok.Value</GroupExpression>
465                  <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>
466                  <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>
467                  <GroupExpression>=switch(Parameters!okres.Label="ROK","",Parameters!okres.Label="PÓŁROCZE","",Parameters!okres.Label="KWARTAŁ","",Parameters!okres.Label="MS",Fields!ms.Value)</GroupExpression>
468                </GroupExpressions>
469              </Grouping>
470              <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>
471            </DynamicCategories>
472          </CategoryGrouping>
473        </CategoryGroupings>
474        <Palette>Default</Palette>
475        <ChartData>
476          <ChartSeries>
477            <DataPoints>
478              <DataPoint>
479                <DataValues>
480                  <DataValue>
481                    <Value>=Sum(Fields!ilosc.Value)</Value>
482                  </DataValue>
483                </DataValues>
484                <DataLabel>
485                  <Style />
486                  <Value>=Sum(Fields!ilosc.Value)</Value>
487                  <Position>Top</Position>
488                  <Rotation>-90</Rotation>
489                  <Visible>true</Visible>
490                </DataLabel>
491                <Style>
492                  <BackgroundColor>Gold</BackgroundColor>
493                </Style>
494                <Marker>
495                  <Size>6pt</Size>
496                </Marker>
497              </DataPoint>
498            </DataPoints>
499          </ChartSeries>
500        </ChartData>
501        <Style>
502          <BackgroundColor>White</BackgroundColor>
503        </Style>
504        <Title>
505          <Caption>ILOŚĆ - zafakturowane (podział wg daty wystawienia faktury) i zapłacone</Caption>
506        </Title>
507      </Chart>
508    </ReportItems>
509    <Height>18.75cm</Height>
510  </Body>
511  <Language>en-US</Language>
512  <TopMargin>1cm</TopMargin>
513  <PageHeight>21cm</PageHeight>
514</Report>
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.