ReportElement constructor
ReportElement({
- required String id,
- required ElementType type,
- double x = 50,
- double y = 50,
- double width = 180,
- double height = 40,
- String value = '',
- double fontSize = 12,
- bool bold = false,
- String textAlign = 'left',
- String fontFamily = 'Helvetica',
- int printColor = 0xff172033,
- String dataSource = 'items',
- List<
ReportColumn> ? columns, - double rowHeight = 24,
- int headerColor = 0xff3156d3,
- int headerTextColor = 0xffffffff,
- int alternateRowColor = 0xfff3f5f9,
- bool showBorders = true,
- String imageBase64 = '',
- String imageName = '',
- String imageFit = 'contain',
- bool showSummary = true,
- bool showSubtotal = true,
- bool showTaxes = true,
- String amountExpression = 'total',
- double discountPercent = 0,
- String discountLabel = 'Rabatt',
- String subtotalLabel = 'Zwischensumme',
- String totalLabel = 'Gesamtbetrag',
- List<
TaxRule> ? taxRules, - List<
AggregateRule> ? aggregateRules, - String lineDirection = 'horizontal',
- double lineThickness = 1.5,
- String codeValue = '',
- String barcodeType = 'ean13',
- bool showCodeText = true,
- String band = 'body',
- String visibilityCondition = '',
- ElementPageVisibility pageVisibility = ElementPageVisibility.all,
- bool locked = false,
- bool keepTogether = false,
- bool flow = false,
- String section = 'body',
- String groupBy = '',
- String groupHeader = '{{group}}',
- bool showGroupHeader = true,
- ChartType chartType = ChartType.bar,
- String chartCategoryField = 'label',
- String chartValueExpression = 'value',
- bool chartShowLegend = true,
- bool chartShowLabels = true,
- List<
int> ? chartColors,
Creates a report element with type-specific styling and data settings.
Implementation
ReportElement({
required this.id,
required this.type,
this.x = 50,
this.y = 50,
this.width = 180,
this.height = 40,
this.value = '',
this.fontSize = 12,
this.bold = false,
this.textAlign = 'left',
this.fontFamily = 'Helvetica',
this.printColor = 0xff172033,
this.dataSource = 'items',
List<ReportColumn>? columns,
this.rowHeight = 24,
this.headerColor = 0xff3156d3,
this.headerTextColor = 0xffffffff,
this.alternateRowColor = 0xfff3f5f9,
this.showBorders = true,
this.imageBase64 = '',
this.imageName = '',
this.imageFit = 'contain',
this.showSummary = true,
this.showSubtotal = true,
this.showTaxes = true,
this.amountExpression = 'total',
this.discountPercent = 0,
this.discountLabel = 'Rabatt',
this.subtotalLabel = 'Zwischensumme',
this.totalLabel = 'Gesamtbetrag',
List<TaxRule>? taxRules,
List<AggregateRule>? aggregateRules,
this.lineDirection = 'horizontal',
this.lineThickness = 1.5,
this.codeValue = '',
this.barcodeType = 'ean13',
this.showCodeText = true,
this.band = 'body',
this.visibilityCondition = '',
this.pageVisibility = ElementPageVisibility.all,
this.locked = false,
this.hidden = false,
this.keepTogether = false,
this.flow = false,
this.section = 'body',
this.groupBy = '',
this.groupHeader = '{{group}}',
this.groupFooter = 'Zwischensumme',
this.showGroupHeader = true,
this.showGroupFooter = true,
this.chartType = ChartType.bar,
this.chartCategoryField = 'label',
this.chartValueExpression = 'value',
this.chartShowLegend = true,
this.chartShowLabels = true,
List<int>? chartColors,
}) : columns = columns ?? [],
taxRules = taxRules ?? [],
aggregateRules = aggregateRules ?? [],
chartColors = chartColors == null || chartColors.isEmpty
? const [0xff3156d3, 0xff22a06b, 0xfff59e0b, 0xffdc4c64, 0xff7c3aed]
: chartColors;