forked from ddrilling/AsbCloudServer
корректировка скрипта миграции
корректировка стилей и блоков
This commit is contained in:
parent
73f804d3d6
commit
c5785fbb5f
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
{
|
||||
public class DailyReportBhaDto
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
{
|
||||
public class DailyReportDimensionlessDto
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
{
|
||||
public class DailyReportSignDto
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
namespace AsbCloudApp.Data.DailyReport
|
||||
{
|
||||
public class DailyReportTimeBalanceDto
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ namespace AsbCloudDb.Migrations
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("DELETE FROM [t_daily_report]", true);
|
||||
migrationBuilder.Sql("DELETE FROM t_daily_report", true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
|
@ -7,12 +7,12 @@ namespace AsbCloudDb.Model.DailyReportDB
|
||||
/// <summary>
|
||||
/// Режимы бурения в роторе
|
||||
/// </summary>
|
||||
public IEnumerable<string> RotorDrillingModes { get; set; }
|
||||
public IEnumerable<string>? RotorDrillingModes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// режимы бурения в слайде
|
||||
/// </summary>
|
||||
public IEnumerable<string> SlideDrillingModes { get; set; }
|
||||
public IEnumerable<string>? SlideDrillingModes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Количество метров пробуренных в роторе за отчетный период
|
||||
|
@ -68,8 +68,10 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
public override void Draw(IXLWorksheet sheet)
|
||||
{
|
||||
|
||||
sheet._Range(AddressDimensionTitle, AddressDimensionTitle + (0, 1))
|
||||
._SetValue("БЕЗМЕТРАЖНЫЕ РАБОТЫ");
|
||||
sheet.Range(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber,
|
||||
AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber + 1)
|
||||
.Merge()
|
||||
.SetValue("БЕЗМЕТРАЖНЫЕ РАБОТЫ");
|
||||
sheet._Range(AddressPreparationTitle, AddressPreparationTitle + (0, 2))
|
||||
._SetValue("Подготовка ствола скв. к наращиванию");
|
||||
sheet._Range(AddressExtensionTitle, AddressExtensionTitle + (0, 2))
|
||||
|
@ -85,10 +85,12 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
}
|
||||
|
||||
public override void Draw(IXLWorksheet sheet)
|
||||
{
|
||||
{
|
||||
sheet._Range(AddressTitle, AddressTitle + (0, 7))
|
||||
._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}")
|
||||
.Style.SetH1();
|
||||
|
||||
.Style.SetH1();
|
||||
|
||||
sheet._Range(AddressCustomer, AddressCustomer + (0, 7))
|
||||
._SetValue($"Заказчик: {blockDto.Customer}")
|
||||
.Style.SetH1();
|
||||
@ -108,10 +110,11 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
sheet._Range(AddressPeriodTableHeadArray[3], AddressPeriodTableHeadArray[3] + (0, 1))
|
||||
._SetValue("До");
|
||||
sheet._Range(AddressPeriodTableDataArray[0], AddressPeriodTableDataArray[0] + (0, 1))
|
||||
._SetValue($"{blockDto.ReportDate}");
|
||||
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1));
|
||||
._SetValue($"{blockDto.ReportDate}");
|
||||
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1))._SetValue("");
|
||||
sheet.Cell(AddressPeriodTableDataArray[1])
|
||||
.SetFormulaA1(string.Format("{0}-1", AddressPeriodTableDataArray[0].ToString()));
|
||||
.SetFormulaA1(string.Format("{0}-1", AddressPeriodTableDataArray[0].ToString()))
|
||||
.Style.DateFormat.Format= "DD.MM.YYYY HH:MM:SS";
|
||||
sheet._Range(AddressPeriodTableDataArray[2], AddressPeriodTableDataArray[2] + (0, 1))
|
||||
._SetValue($"{blockDto.WellDepthIntervalStartDate}");
|
||||
sheet._Range(AddressPeriodTableDataArray[3], AddressPeriodTableDataArray[3] + (0, 1))
|
||||
|
@ -41,8 +41,9 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
public override CellAddress AddressBlockBegin { get; }
|
||||
public override CellAddress AddressBlockEnd { get; }
|
||||
|
||||
public SaubBlock(CellAddress addressBlockBegin, DailyReportSaubDto blockDto)
|
||||
public SaubBlock(CellAddress addressBlockBegin, DailyReportSaubDto blockDto, HeadBlock headBlock)
|
||||
{
|
||||
this.headBlock = headBlock;
|
||||
AddressBlockBegin = addressBlockBegin.Copy();
|
||||
this.blockDto = blockDto;
|
||||
AddressRotorDrilling = addressBlockBegin + (1, 0);
|
||||
@ -109,9 +110,13 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
|
||||
private string FormulaSinking(CellAddress sinkingDrilling, CellAddress sinkingSlide, CellAddress slaughterEnd, CellAddress slaughterBegin)
|
||||
{
|
||||
return string.Format($"=IF(({{0}}+{{1}})<>({{2}}-{{3}});\"ОШИБКА\";({{4}}+{{5}}))", sinkingSlide.ToString(), sinkingDrilling.ToString()
|
||||
, slaughterEnd.ToString(), slaughterBegin.ToString(),
|
||||
sinkingSlide.ToString(), sinkingDrilling.ToString());
|
||||
return string.Format($"=IF(({{0}}+{{1}})<>({{2}}-{{3}}),\"ОШИБКА\",({{0}}+{{1}}))", sinkingSlide.ToString(), sinkingDrilling.ToString(),
|
||||
slaughterEnd.ToString(), slaughterBegin.ToString());
|
||||
}
|
||||
private string FormulaWatch(CellAddress cellSinkingDrill, CellAddress cellSinkingSlide)
|
||||
{
|
||||
return string.Format("={0}+{1}",
|
||||
cellSinkingDrill.ToString(), cellSinkingSlide.ToString());
|
||||
}
|
||||
|
||||
public override void Draw(IXLWorksheet sheet)
|
||||
@ -134,7 +139,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
._SetValue($"{blockDto.PenetrationInRotor}");
|
||||
sheet._Range(AddressDrillingTableData[1], AddressDrillingTableData[1] + (0, 1))
|
||||
._SetValue($"{blockDto.NumberDrillingHours}");
|
||||
sheet._Range(AddressDrillingTableData[2], AddressDrillingTableData[2] + (0, 1));
|
||||
sheet._Range(AddressDrillingTableData[2], AddressDrillingTableData[2] + (0, 1))._SetValue("");
|
||||
sheet.Cell(AddressDrillingTableData[2])
|
||||
.SetFormulaA1(FormulaMechanicalSpeed(AddressDrillingTableData[0], AddressDrillingTableData[1])).Style.SetAllBorders();
|
||||
sheet._Range(AddressDrillingTableData[3], AddressDrillingTableData[3] + (0, 1))
|
||||
@ -153,7 +158,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
._SetValue($"{blockDto.PenetrationInSlide}");
|
||||
sheet._Range(AddressSlideTableData[1], AddressSlideTableData[1] + (0, 1))
|
||||
._SetValue($"{blockDto.DrillingTimeInRotor}");
|
||||
sheet._Range(AddressSlideTableData[2], AddressSlideTableData[2] + (0, 1));
|
||||
sheet._Range(AddressSlideTableData[2], AddressSlideTableData[2] + (0, 1))._SetValue("");
|
||||
sheet.Cell(AddressSlideTableData[2])
|
||||
.SetFormulaA1(FormulaMechanicalSpeed(AddressSlideTableData[0], AddressSlideTableData[1])).Style.SetAllBorders();
|
||||
sheet._Range(AddressSlideTableData[3], AddressSlideTableData[3] + (0, 1))
|
||||
@ -168,14 +173,13 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
._SetValue("Часы бурения");
|
||||
sheet._Range(AddressTotalTableHead[2], AddressTotalTableHead[2] + (0, 1))
|
||||
._SetValue("Мех. скорость");
|
||||
var formulaWatch = string.Format("={0}+{1}",
|
||||
AddressDrillingTableData[1].ToString(), AddressSlideTableData[1].ToString());
|
||||
sheet._Range(AddressTotalTableData[0], AddressTotalTableData[0] + (0, 1));
|
||||
|
||||
sheet._Range(AddressTotalTableData[0], AddressTotalTableData[0] + (0, 1))._SetValue("");
|
||||
sheet.Cell(AddressTotalTableData[0])
|
||||
.SetFormulaA1(formulaWatch).Style.SetAllBorders();
|
||||
sheet._Range(AddressTotalTableData[1], AddressTotalTableData[1] + (0, 1));
|
||||
.SetFormulaA1(FormulaSinking(AddressDrillingTableData[0], AddressSlideTableData[0], headBlock.AddressPeriodTableDataArray[3], headBlock.AddressPeriodTableDataArray[2]));
|
||||
sheet._Range(AddressTotalTableData[1], AddressTotalTableData[1] + (0, 1))._SetValue("");
|
||||
sheet.Cell(AddressTotalTableData[1])
|
||||
.SetFormulaA1(formulaWatch).Style.SetAllBorders();
|
||||
.SetFormulaA1(FormulaWatch(AddressDrillingTableData[1], AddressSlideTableData[1]));
|
||||
sheet._Range(AddressTotalTableData[2], AddressTotalTableData[2] + (0, 1))
|
||||
._SetValue("");
|
||||
sheet._Range(AddressTotalTableData[3], AddressTotalTableData[3] + (0, 1))
|
||||
@ -208,10 +212,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
._SetValue("Проходка за секцию");
|
||||
sheet._Range(SectionPenetrationTotalValue, SectionPenetrationTotalValue + (0, 3))
|
||||
._SetValue($"{blockDto.SectionPenetrationTotal}");
|
||||
|
||||
CellAddress test = AddressExtensionsCount + (0, 3);
|
||||
|
||||
sheet._Range(AddressExtensionsCount, test)
|
||||
sheet._Range(AddressExtensionsCount, AddressExtensionsCount + (0, 3))
|
||||
._SetValue("Кол- во наращиваний");
|
||||
sheet._Range(AddressExtensionsCountValue, AddressExtensionsCountValue + (0, 3))
|
||||
._SetValue($"{blockDto.ExtensionsCount}");
|
||||
@ -221,7 +222,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
._SetValue($"{blockDto.DeviationFromTVD}");
|
||||
sheet._Range(DeclinesReasonsROP, DeclinesReasonsROP + (1, 7))
|
||||
._SetValue($"Примечание: {blockDto.DeclinesReasonsROP}");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,22 +19,30 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
AddressBlockBegin = addressBlockBegin.Copy();
|
||||
this.blockDto = blockDto;
|
||||
AddressDrillMasterHead = addressBlockBegin + (3, 0);
|
||||
AddressDrillMaster = AddressDrillMasterHead + (0, 6);
|
||||
AddressDrillMaster = AddressDrillMasterHead + (0, 5);
|
||||
AddressSupervisorHead = AddressDrillMasterHead + (2, 0);
|
||||
AddressSupervisor = AddressSupervisorHead + (0, 6);
|
||||
AddressSupervisor = AddressSupervisorHead + (0, 5);
|
||||
AddressBlockEnd = AddressSupervisor + (0,1);
|
||||
}
|
||||
|
||||
public override void Draw(IXLWorksheet sheet)
|
||||
{
|
||||
sheet._Range(AddressDrillMasterHead, AddressDrillMasterHead + (0, 2))
|
||||
._SetValue("Мастер буровой ");
|
||||
sheet._Range(AddressDrillMaster, AddressDrillMaster + (0, 2))
|
||||
._SetValue($"{blockDto.DrillingMaster}");
|
||||
sheet._Range(AddressSupervisorHead, AddressSupervisorHead + (0, 2))
|
||||
._SetValue("Супервайзер ");
|
||||
sheet._Range(AddressSupervisor, AddressSupervisor + (0, 2))
|
||||
._SetValue($"{blockDto.Supervisor}");
|
||||
sheet.Range(AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber
|
||||
, AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber + 2)
|
||||
.Merge()
|
||||
.SetValue("Мастер буровой ");
|
||||
sheet.Range(AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber
|
||||
, AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber + 2)
|
||||
.Merge()
|
||||
.SetValue($"{blockDto.DrillingMaster}");
|
||||
sheet.Range(AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber
|
||||
, AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber + 2)
|
||||
.Merge()
|
||||
.SetValue("Супервайзер ");
|
||||
sheet.Range(AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber
|
||||
, AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber + 2)
|
||||
.Merge()
|
||||
.SetValue($"{blockDto.Supervisor}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,50 +52,50 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
||||
AddressBlockBegin = addressBlockBegin.Copy();
|
||||
this.blockDto = blockDto;
|
||||
AddressTitle = addressBlockBegin + (1, 3);
|
||||
AddressDrilling = addressBlockBegin + (4, 1);
|
||||
AddressFlushing = addressBlockBegin + (5, 1);
|
||||
AddressBuilding = addressBlockBegin + (6, 1);
|
||||
AddressElaboration = addressBlockBegin + (7, 1);
|
||||
AddressExtension = addressBlockBegin + (8, 1);
|
||||
AddressRepair = addressBlockBegin + (9, 1);
|
||||
AddressDrillingValue = addressBlockBegin + (4, 2);
|
||||
AddressFlushingValue = addressBlockBegin + (5, 2);
|
||||
AddressBuildingValue = addressBlockBegin + (6, 2);
|
||||
AddressElaborationValue = addressBlockBegin + (7, 2);
|
||||
AddressExtensionValue = addressBlockBegin + (8, 2);
|
||||
AddressRepairValue = addressBlockBegin + (9, 2);
|
||||
AddressKnbk = addressBlockBegin + (4, 3);
|
||||
AddressSpo = addressBlockBegin + (5, 3);
|
||||
AddressPzr = addressBlockBegin + (6, 3);
|
||||
AddressPvo = addressBlockBegin + (7, 3);
|
||||
AddressPgr = addressBlockBegin + (8, 3);
|
||||
AddressGis = addressBlockBegin + (9, 3);
|
||||
AddressKnbkValue = addressBlockBegin + (4, 4);
|
||||
AddressSpoValue = addressBlockBegin + (5, 4);
|
||||
AddressPzrValue = addressBlockBegin + (6, 4);
|
||||
AddressPvoValue = addressBlockBegin + (7, 4);
|
||||
AddressPgrValue = addressBlockBegin + (8, 4);
|
||||
AddressGisValue = addressBlockBegin + (9, 4);
|
||||
AddressOzc = addressBlockBegin + (4, 5);
|
||||
AddressEngineeringWorks = addressBlockBegin + (5, 5);
|
||||
AddressTakingMeasure = addressBlockBegin + (6, 5);
|
||||
AddressCementing = addressBlockBegin + (7, 5);
|
||||
AddressSimple = addressBlockBegin + (8, 5);
|
||||
AddressNpv = addressBlockBegin + (9, 5);
|
||||
AddressOzcValue = addressBlockBegin + (4, 6);
|
||||
AddressEngineeringWorksValue = addressBlockBegin + (5, 6);
|
||||
AddressTakingMeasureValue = addressBlockBegin + (6, 6);
|
||||
AddressCementingValue = addressBlockBegin + (7, 6);
|
||||
AddressSimpleValue = addressBlockBegin + (8, 6);
|
||||
AddressNpvValue = addressBlockBegin + (9, 6);
|
||||
AddressDrilling = addressBlockBegin + (2, 1);
|
||||
AddressFlushing = addressBlockBegin + (3, 1);
|
||||
AddressBuilding = addressBlockBegin + (4, 1);
|
||||
AddressElaboration = addressBlockBegin + (5, 1);
|
||||
AddressExtension = addressBlockBegin + (6, 1);
|
||||
AddressRepair = addressBlockBegin + (7, 1);
|
||||
AddressDrillingValue = addressBlockBegin + (2, 2);
|
||||
AddressFlushingValue = addressBlockBegin + (3, 2);
|
||||
AddressBuildingValue = addressBlockBegin + (4, 2);
|
||||
AddressElaborationValue = addressBlockBegin + (5, 2);
|
||||
AddressExtensionValue = addressBlockBegin + (6, 2);
|
||||
AddressRepairValue = addressBlockBegin + (7, 2);
|
||||
AddressKnbk = addressBlockBegin + (2, 3);
|
||||
AddressSpo = addressBlockBegin + (3, 3);
|
||||
AddressPzr = addressBlockBegin + (4, 3);
|
||||
AddressPvo = addressBlockBegin + (5, 3);
|
||||
AddressPgr = addressBlockBegin + (6, 3);
|
||||
AddressGis = addressBlockBegin + (7, 3);
|
||||
AddressKnbkValue = addressBlockBegin + (2, 4);
|
||||
AddressSpoValue = addressBlockBegin + (3, 4);
|
||||
AddressPzrValue = addressBlockBegin + (4, 4);
|
||||
AddressPvoValue = addressBlockBegin + (5, 4);
|
||||
AddressPgrValue = addressBlockBegin + (6, 4);
|
||||
AddressGisValue = addressBlockBegin + (7, 4);
|
||||
AddressOzc = addressBlockBegin + (2, 5);
|
||||
AddressEngineeringWorks = addressBlockBegin + (3, 5);
|
||||
AddressTakingMeasure = addressBlockBegin + (4, 5);
|
||||
AddressCementing = addressBlockBegin + (5, 5);
|
||||
AddressSimple = addressBlockBegin + (6, 5);
|
||||
AddressNpv = addressBlockBegin + (7, 5);
|
||||
AddressOzcValue = addressBlockBegin + (2, 6);
|
||||
AddressEngineeringWorksValue = addressBlockBegin + (3, 6);
|
||||
AddressTakingMeasureValue = addressBlockBegin + (4, 6);
|
||||
AddressCementingValue = addressBlockBegin + (5, 6);
|
||||
AddressSimpleValue = addressBlockBegin + (6, 6);
|
||||
AddressNpvValue = addressBlockBegin + (7, 6);
|
||||
AddressBlockEnd = AddressNpvValue;
|
||||
}
|
||||
|
||||
public override void Draw(IXLWorksheet sheet)
|
||||
{
|
||||
|
||||
sheet._Range(AddressTitle, AddressTitle + (0, 1))
|
||||
._SetValue("БАЛАНС ВРЕМЕНИ");
|
||||
sheet.Range(AddressTitle.RowNumber, AddressTitle.ColumnNumber, AddressTitle.RowNumber, AddressTitle.ColumnNumber + 1)
|
||||
.Merge()
|
||||
.SetValue("БАЛАНС ВРЕМЕНИ");
|
||||
sheet.Cell(AddressDrilling)
|
||||
._SetValue("Бурение");
|
||||
sheet.Cell(AddressFlushing)
|
||||
|
@ -19,32 +19,32 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
||||
private void FillExampleBlocks(XLWorkbook workbook, DailyReportDto dto)
|
||||
{
|
||||
var sheet = workbook.Worksheets.Add(dto.Head.ReportDate.ToString("dd.MM.yyyy"));
|
||||
var addressStart = new CellAddress(sheet, 1, 1);
|
||||
var addressStart = new CellAddress(sheet, 2, 2);
|
||||
var blockHeader = new HeadBlock(addressStart, dto.Head);
|
||||
addressStart = blockHeader.AddressBlockEnd + (1, 0);
|
||||
addressStart.ColumnNumber = 1;
|
||||
addressStart.ColumnNumber = 2;
|
||||
var blockBha = new BhaBlock(addressStart, dto.Bha);
|
||||
addressStart = blockBha.AddressBlockEnd + (1, 0);
|
||||
addressStart.ColumnNumber = 1;
|
||||
addressStart.ColumnNumber = 2;
|
||||
var timeBalance = new TimeBalanceBlock(addressStart, dto.TimeBalance);
|
||||
addressStart = timeBalance.AddressBlockEnd + (1, 0);
|
||||
addressStart.ColumnNumber = 1;
|
||||
addressStart.ColumnNumber = 2;
|
||||
var blockDimensionless = new DimensionlessBlock(addressStart, dto.Dimensionless);
|
||||
addressStart = blockDimensionless.AddressBlockEnd + (1, 0);
|
||||
addressStart.ColumnNumber = 1;
|
||||
var blockSaub = new SaubBlock(addressStart, dto.Saub);
|
||||
addressStart.ColumnNumber = 2;
|
||||
var blockSaub = new SaubBlock(addressStart, dto.Saub, blockHeader);
|
||||
addressStart = blockSaub.AddressBlockEnd + (1, 0);
|
||||
blockDimensionless.SaubBlock = blockSaub;
|
||||
addressStart.ColumnNumber = 1;
|
||||
addressStart.ColumnNumber = 2;
|
||||
var blockSign = new SignBlock(addressStart, dto.Sign);
|
||||
addressStart = blockSign.AddressBlockEnd + (1, 0);
|
||||
addressStart.ColumnNumber = 1;
|
||||
addressStart.ColumnNumber = 2;
|
||||
blockHeader.Draw(sheet);
|
||||
blockBha.Draw(sheet);
|
||||
timeBalance.Draw(sheet);
|
||||
blockDimensionless.Draw(sheet);
|
||||
blockSaub.Draw(sheet);
|
||||
blockSign.Draw(sheet);
|
||||
blockSign.Draw(sheet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,11 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
||||
{
|
||||
public static IXLRange _SetValue(this IXLRange range, object value)
|
||||
{
|
||||
var mergedRange = range.Merge();
|
||||
var mergedRange = range.Merge();
|
||||
mergedRange.Style.SetAllBorders()
|
||||
.Alignment.WrapText = true; ;
|
||||
mergedRange.FirstCell()._SetValue(value);
|
||||
mergedRange.Style.SetAllBorders();
|
||||
|
||||
return mergedRange;
|
||||
}
|
||||
|
||||
@ -34,7 +36,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
||||
return cell;
|
||||
}
|
||||
|
||||
public static IXLCell _SetValue(this IXLCell cell, string value, bool adaptRowHeight = false)
|
||||
public static IXLCell _SetValue(this IXLCell cell, string value, bool adaptRowHeight = false, int noBorder = 0)
|
||||
{
|
||||
cell.Value = value;
|
||||
cell.Style
|
||||
@ -45,18 +47,22 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
||||
|
||||
if (adaptRowHeight)
|
||||
{
|
||||
var colWidth = cell.WorksheetColumn().Width;
|
||||
var maxCharsToWrap = colWidth / (0.1d * cell.Style.Font.FontSize); // TODO: Подобрать коэффициент
|
||||
if(value.Length > maxCharsToWrap)
|
||||
var colWidth = cell.WorksheetColumn().Width;
|
||||
var maxCharsToWrap = 88;
|
||||
if (value.Length > maxCharsToWrap)
|
||||
{
|
||||
var row = cell.WorksheetRow();
|
||||
var baseHeight = row.Height;
|
||||
row.Height = 0.82d * baseHeight * Math.Ceiling(1d + value.Length / maxCharsToWrap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static IXLCell _SetValue(this IXLCell cell, DateTime value, string dateFormat = "DD.MM.YYYY HH:MM:SS")
|
||||
{
|
||||
@ -122,5 +128,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
||||
/// <returns></returns>
|
||||
public static IXLRange _Range(this IXLWorksheet sheet, CellAddress begin, CellAddress end)
|
||||
=> sheet.Range(begin.RowNumber, begin.ColumnNumber, end.RowNumber, end.ColumnNumber);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user