надеюс все

This commit is contained in:
Ino 2023-04-10 16:40:13 +04:00
parent ad9f05bb00
commit 3a37421bb6
5 changed files with 398 additions and 411 deletions

View File

@ -50,16 +50,10 @@ namespace IceCreamBusinessLogic.OfficePackage
Style = "NormalTitle", Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
CreateParagraph(new PdfParagraph
{
Text = $"с{info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateTable(new List<string> { "3cm", "3cm", "7cm" }); CreateTable(new List<string> { "3cm", "3cm", "7cm" });
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
Texts = new List<string> { "Дата заказа", "Количество заказов", "Сумма" }, Texts = new List<string> { "Дата", "Количество", "Сумма" },
Style = "NormalTitle", Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
@ -76,7 +70,7 @@ namespace IceCreamBusinessLogic.OfficePackage
{ {
Text = $"Итого: {info.DateOrders.Sum(x => x.SumOrders)}\t", Text = $"Итого: {info.DateOrders.Sum(x => x.SumOrders)}\t",
Style = "Normal", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Right ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
SavePdf(info); SavePdf(info);
} }

View File

@ -9,6 +9,7 @@ namespace IceCreamBusinessLogic.OfficePackage.HelperModels
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public List<ReportIceCreamComponentViewModel> IceCreamComponents { get; set; } = new(); public List<ReportIceCreamComponentViewModel> IceCreamComponents { get; set; } = new();
public List<ReportShopWorkloadViewModel> ShopIceCreams { get; set; } = new(); public List<ReportShopWorkloadViewModel> ShopIceCreams { get; set; } = new();
} }
} }

View File

@ -25,7 +25,7 @@ namespace IceCreamShopView
{ {
try try
{ {
_logic.SaveIceCreamsToWordFile(new ReportBindingModel _logic.SaveShopWorkloadToExcelFile(new ReportBindingModel
{ {
FileName = dialog.FileName FileName = dialog.FileName
}); });

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body> <Body>
<ReportItems> <ReportItems>
<Textbox Name="TextboxTitle"> <Textbox Name="TextboxTitle">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@ -23,6 +21,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Top>0.24cm</Top>
<Height>1cm</Height> <Height>1cm</Height>
<Width>21cm</Width> <Width>21cm</Width>
<Style> <Style>
@ -36,7 +35,6 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Tablix Name="Tablix1"> <Tablix Name="Tablix1">
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
@ -269,7 +267,7 @@
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSetOrders</DataSetName> <DataSetName>DataSetOrders</DataSetName>
<Top>2.48391cm</Top> <Top>2.72391cm</Top>
<Left>0.55245cm</Left> <Left>0.55245cm</Left>
<Height>1.2cm</Height> <Height>1.2cm</Height>
<Width>13cm</Width> <Width>13cm</Width>
@ -280,7 +278,6 @@
</Border> </Border>
</Style> </Style>
</Tablix> </Tablix>
<Textbox Name="TextboxTotalSum"> <Textbox Name="TextboxTotalSum">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@ -299,7 +296,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Top>4cm</Top> <Top>4.24cm</Top>
<Left>8.55245cm</Left> <Left>8.55245cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
@ -314,7 +311,6 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="SumTotal"> <Textbox Name="SumTotal">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@ -333,7 +329,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Top>4cm</Top> <Top>4.24cm</Top>
<Left>11.05245cm</Left> <Left>11.05245cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
@ -348,13 +344,11 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
</ReportItems> </ReportItems>
<Height>5.72875cm</Height> <Height>2in</Height>
<Style /> <Style />
</Body> </Body>
<Width>8.26772in</Width>
<Width>21cm</Width>
<Page> <Page>
<PageHeight>29.7cm</PageHeight> <PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth> <PageWidth>21cm</PageWidth>
@ -366,19 +360,15 @@
<Style /> <Style />
</Page> </Page>
<AutoRefresh>0</AutoRefresh> <AutoRefresh>0</AutoRefresh>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>e6968c47-74e2-4a36-be2a-eb9e655f8afd</rd:ReportID>
<DataSources> <DataSources>
<DataSource Name="IceCreamShopContractsViewModels"> <DataSource Name="IceCreamShopContractsViewModels">
<ConnectionProperties> <ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider> <DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString> <ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties> </ConnectionProperties>
<rd:DataSourceID>bf577a27-98a7-43b2-8beb-1a37d37ce5cd</rd:DataSourceID> <rd:DataSourceID>10791c83-cee8-4a38-bbd0-245fc17cefb3</rd:DataSourceID>
</DataSource> </DataSource>
</DataSources> </DataSources>
<DataSets> <DataSets>
<DataSet Name="DataSetOrders"> <DataSet Name="DataSetOrders">
<Query> <Query>
@ -401,9 +391,11 @@
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>IceCreamShopContracts.ViewModels</rd:DataSetName> <rd:DataSetName>IceCreamShopContracts.ViewModels</rd:DataSetName>
<rd:TableName>ReportOrderViewModel</rd:TableName> <rd:TableName>ReportDateOrdersViewModel</rd:TableName>
<rd:ObjectDataSourceType>IceCreamShopContracts.ViewModels.ReportDateOrdersViewModel, IceCreamShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType> <rd:ObjectDataSourceType>IceCreamShopContracts.ViewModels.ReportDateOrdersViewModel, IceCreamShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
</rd:DataSetInfo> </rd:DataSetInfo>
</DataSet> </DataSet>
</DataSets> </DataSets>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>cd561cee-f04c-45db-850e-4c793555accd</rd:ReportID>
</Report> </Report>

View File

@ -46,9 +46,9 @@ namespace IceCreamShopContracts.BusinessLogicsContracts
/// <param name="model"></param> /// <param name="model"></param>
void SaveShopsToWordFile(ReportBindingModel model); void SaveShopsToWordFile(ReportBindingModel model);
public void SaveShopWorkloadToExcelFile(ReportBindingModel model); void SaveShopWorkloadToExcelFile(ReportBindingModel model);
public List<ReportShopWorkloadViewModel> GetShopIceCreams(); List<ReportShopWorkloadViewModel> GetShopIceCreams();
List<ReportDateOrdersViewModel> GetDateOrders(); List<ReportDateOrdersViewModel> GetDateOrders();