123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version="1.0" encoding="utf-8"?>
- <Report ScriptLanguage="CSharp" ReportInfo.Description="Demonstrates the following AdvMatrixObject features: - user-defined aggregate function (see the report script code)" ReportInfo.Created="05/16/2008 01:44:40" ReportInfo.Modified="04/07/2023 17:58:53" ReportInfo.CreatorVersion="1.0.0.0">
- <ScriptText>using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Drawing;
- using System.Data;
- using FastReport;
- using FastReport.Data;
- using FastReport.Dialog;
- using FastReport.Barcode;
- using FastReport.Table;
- using FastReport.Utils;
- namespace FastReport
- {
- public class ReportScript
- {
- public object _Sum(List<dynamic> l)
- {
- dynamic value = 0;
- foreach (dynamic v in l)
- value += v;
- return value;
- }
- }
- }
- </ScriptText>
- <Dictionary>
- <TableDataSource Name="MatrixDemo" ReferenceName="NorthWind.MatrixDemo" DataType="System.Int32" Enabled="true">
- <Column Name="Name" DataType="System.String"/>
- <Column Name="Year" DataType="System.Int32"/>
- <Column Name="Month" DataType="System.Int32"/>
- <Column Name="ItemsSold" DataType="System.Int32"/>
- <Column Name="Revenue" DataType="System.Decimal"/>
- </TableDataSource>
- </Dictionary>
- <ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
- <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8" CanGrow="true">
- <TextObject Name="Text1" Width="718.2" Height="37.8" Text="REVENUE BY EMPLOYEE" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 14pt, style=Bold"/>
- </ReportTitleBand>
- <DataBand Name="Data1" Top="39.8" Width="718.2" Height="87.52">
- <AdvMatrixObject Name="Matrix1" Left="9.45" Top="11.92" Width="313.74" Height="66.15" DataSource="MatrixDemo">
- <Columns>
- <Descriptor Expression="[MatrixDemo.Year]"/>
- <Descriptor DisplayText="Total"/>
- </Columns>
- <Rows>
- <Descriptor Expression="[MatrixDemo.Name]"/>
- <Descriptor DisplayText="Total"/>
- </Rows>
- <TableColumn Name="Column1" Width="103.95"/>
- <TableColumn Name="Column2" Width="98.28" AutoSize="true"/>
- <TableColumn Name="Column3" Width="111.51" AutoSize="true"/>
- <TableRow Name="Row1" Height="28.35">
- <TableCell Name="Cell1" Border.Lines="All" Border.Color="White" Fill.Color="LightGray" Text="Employee" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell2" Border.Lines="All" Border.Color="White" Fill.Color="LightGray" Text="[Year]" AllowExpressions="false" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell7" Border.Lines="All" Border.Color="White" Fill.Color="LightGray" Text="Total" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- </TableRow>
- <TableRow Name="Row2">
- <TableCell Name="Cell3" Border.Lines="All" Border.Color="White" Fill.Color="LightGray" Text="[Name]" AllowExpressions="false" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell4" Border.Lines="All" Border.Color="White" Fill.Color="WhiteSmoke" Text="[_Sum([MatrixDemo.Revenue])]" AllowExpressions="false" Format="Currency" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell8" Border.Lines="All" Border.Color="White" Fill.Color="WhiteSmoke" Text="[_Sum([MatrixDemo.Revenue])]" AllowExpressions="false" Format="Currency" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" Font="Segoe UI, 9pt"/>
- </TableRow>
- <TableRow Name="Row4">
- <TableCell Name="Cell5" Border.Lines="All" Border.Color="White" Fill.Color="LightGray" Text="Total" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- <TableCell Name="Cell6" Border.Lines="All" Border.Color="White" Fill.Color="WhiteSmoke" Text="[_Sum([MatrixDemo.Revenue])]" AllowExpressions="false" Format="Currency" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" Font="Segoe UI, 9pt"/>
- <TableCell Name="Cell9" Border.Lines="All" Border.Color="White" Fill.Color="WhiteSmoke" Text="[_Sum([MatrixDemo.Revenue])]" AllowExpressions="false" Format="Currency" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" Font="Segoe UI, 9pt, style=Bold"/>
- </TableRow>
- </AdvMatrixObject>
- </DataBand>
- <PageFooterBand Name="PageFooter1" Top="129.32" Width="718.2" Height="28.35" Fill.Color="WhiteSmoke">
- <TextObject Name="Text12" Left="9.45" Width="217.35" Height="28.35" Cursor="Hand" Hyperlink.Value="https://www.fast-report.com/en/product/fast-report-net/" Text="Generated by FastReport" VertAlign="Center" Font="Segoe UI, 9pt, style=Underline" TextFill.Color="Blue"/>
- </PageFooterBand>
- </ReportPage>
- </Report>
|