root/branches/Emisje/RaportySQL/WykresNettoIlosc3_2009.rdl

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

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

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