сумму сделал
This commit is contained in:
parent
9bccfe9508
commit
1ace32084e
@ -48,12 +48,24 @@ namespace ComputersShop
|
|||||||
DateFrom = dateTimePickerFrom.Value,
|
DateFrom = dateTimePickerFrom.Value,
|
||||||
DateTo = dateTimePickerTo.Value
|
DateTo = dateTimePickerTo.Value
|
||||||
});
|
});
|
||||||
|
double sum = 0;
|
||||||
|
foreach ( var order in dataSource)
|
||||||
|
{
|
||||||
|
sum += order.Sum;
|
||||||
|
}
|
||||||
var source = new ReportDataSource("DataSetOrders", dataSource);
|
var source = new ReportDataSource("DataSetOrders", dataSource);
|
||||||
reportViewer.LocalReport.DataSources.Clear();
|
reportViewer.LocalReport.DataSources.Clear();
|
||||||
reportViewer.LocalReport.DataSources.Add(source);
|
reportViewer.LocalReport.DataSources.Add(source);
|
||||||
var parameters = new[] { new ReportParameter("ReportParameterPeriod",
|
var parameters = new[] { new ReportParameter("ReportParameterPeriod",
|
||||||
$"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") };
|
$"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}"),
|
||||||
reportViewer.LocalReport.SetParameters(parameters);
|
new ReportParameter("ReportParameterSum", sum.ToString())
|
||||||
|
};
|
||||||
|
reportViewer.LocalReport.SetParameters(parameters); //даты
|
||||||
|
|
||||||
|
//штука для вычисления суммы
|
||||||
|
//var sum = new[] { new ReportParameter("ReportParameterSum", "hhh") };
|
||||||
|
//reportViewer.LocalReport.SetParameters(sum);
|
||||||
|
|
||||||
reportViewer.RefreshReport();
|
reportViewer.RefreshReport();
|
||||||
_logger.LogInformation("Загрузка списка заказов на период {From}-{ To}",
|
_logger.LogInformation("Загрузка списка заказов на период {From}-{ To}",
|
||||||
dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
|
dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString());
|
||||||
|
@ -492,7 +492,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>«Expr»</Value>
|
<Value>=Parameters!ReportParameterSum.Value</Value>
|
||||||
<Style />
|
<Style />
|
||||||
</TextRun>
|
</TextRun>
|
||||||
</TextRuns>
|
</TextRuns>
|
||||||
@ -502,7 +502,7 @@
|
|||||||
<Top>5.9182cm</Top>
|
<Top>5.9182cm</Top>
|
||||||
<Left>16.46154cm</Left>
|
<Left>16.46154cm</Left>
|
||||||
<Height>0.6cm</Height>
|
<Height>0.6cm</Height>
|
||||||
<Width>2.5cm</Width>
|
<Width>4.45792cm</Width>
|
||||||
<ZIndex>4</ZIndex>
|
<ZIndex>4</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
@ -537,6 +537,11 @@
|
|||||||
<Nullable>true</Nullable>
|
<Nullable>true</Nullable>
|
||||||
<Prompt>ReportParameter1</Prompt>
|
<Prompt>ReportParameter1</Prompt>
|
||||||
</ReportParameter>
|
</ReportParameter>
|
||||||
|
<ReportParameter Name="ReportParameterSum">
|
||||||
|
<DataType>String</DataType>
|
||||||
|
<Nullable>true</Nullable>
|
||||||
|
<Prompt>ReportParameter1</Prompt>
|
||||||
|
</ReportParameter>
|
||||||
</ReportParameters>
|
</ReportParameters>
|
||||||
<ReportParametersLayout>
|
<ReportParametersLayout>
|
||||||
<GridLayoutDefinition>
|
<GridLayoutDefinition>
|
||||||
@ -548,6 +553,11 @@
|
|||||||
<RowIndex>0</RowIndex>
|
<RowIndex>0</RowIndex>
|
||||||
<ParameterName>ReportParameterPeriod</ParameterName>
|
<ParameterName>ReportParameterPeriod</ParameterName>
|
||||||
</CellDefinition>
|
</CellDefinition>
|
||||||
|
<CellDefinition>
|
||||||
|
<ColumnIndex>1</ColumnIndex>
|
||||||
|
<RowIndex>0</RowIndex>
|
||||||
|
<ParameterName>ReportParameterSum</ParameterName>
|
||||||
|
</CellDefinition>
|
||||||
</CellDefinitions>
|
</CellDefinitions>
|
||||||
</GridLayoutDefinition>
|
</GridLayoutDefinition>
|
||||||
</ReportParametersLayout>
|
</ReportParametersLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user