Skip to content

Commit

Permalink
increase some report's excel table columns width
Browse files Browse the repository at this point in the history
  • Loading branch information
vananiev committed May 31, 2023
1 parent ff9a52a commit 92d23b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public DerivativesMarketProfitExcelTableView(PortfolioRepository portfolioReposi
protected void writeHeader(Sheet sheet, Class<? extends TableHeader> headerType, CellStyle style) {
super.writeHeader(sheet, headerType, style);
sheet.setColumnWidth(CONTRACT.ordinal(), 24 * 256);
sheet.setColumnWidth(AMOUNT.ordinal(), 16 * 256);
sheet.setColumnWidth(AMOUNT.ordinal(), 18 * 256);
sheet.setColumnWidth(DERIVATIVE_PROFIT_DAY.ordinal(), 17 * 256);
sheet.setColumnWidth(DERIVATIVE_PROFIT_TOTAL.ordinal(), 17 * 256);
sheet.setColumnWidth(POSITION.ordinal(), 17 * 256);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,11 @@ protected void writeHeader(Sheet sheet, Class<? extends TableHeader> headerType,
sheet.setColumnWidth(BUY_COUNT.ordinal(), 12 * 256);
sheet.setColumnWidth(CELL_COUNT.ordinal(), 12 * 256);
sheet.setColumnWidth(COUNT.ordinal(), 14 * 256);
sheet.setColumnWidth(AVERAGE_PRICE.ordinal(), 14 * 256);
sheet.setColumnWidth(AVERAGE_PRICE.ordinal(), 15 * 256);
sheet.setColumnWidth(AVERAGE_ACCRUED_INTEREST.ordinal(), 14 * 256);
sheet.setColumnWidth(COMMISSION.ordinal(), 13 * 256);
sheet.setColumnWidth(COMMISSION.ordinal(), 14 * 256);
sheet.setColumnWidth(LAST_EVENT_DATE.ordinal(), 14 * 256);
sheet.setColumnWidth(AMORTIZATION.ordinal(), 16 * 256);
sheet.setColumnWidth(LAST_PRICE.ordinal(), 13 * 256);
sheet.setColumnWidth(LAST_ACCRUED_INTEREST.ordinal(), 13 * 256);
sheet.setColumnWidth(TAX.ordinal(), 19 * 256);
sheet.setColumnWidth(INTERNAL_RATE_OF_RETURN.ordinal(), (int) (12.5 * 256));
Expand Down Expand Up @@ -178,7 +177,7 @@ protected Table.Record getTotalRow(Table table, Optional<Portfolio> portfolio) {
@Override
protected void sheetPreCreate(Sheet sheet, Table table) {
super.sheetPreCreate(sheet, table);
sheet.setZoom(82); // show all columns for 24-inch monitor for securities sheet
sheet.setZoom(81); // show all columns for 24-inch monitor for securities sheet
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ protected void writeHeader(Sheet sheet, Class<? extends TableHeader> headerType,
sheet.setColumnWidth(SECURITY.ordinal(), 45 * 256);
sheet.setColumnWidth(OPEN_AMOUNT.ordinal(), 16 * 256);
sheet.setColumnWidth(CLOSE_AMOUNT.ordinal(), 16 * 256);
sheet.setColumnWidth(COUPON.ordinal(), 15 * 256);
sheet.setColumnWidth(PROFIT.ordinal(), 15 * 256);
}

@Override
Expand All @@ -108,6 +110,7 @@ protected void sheetPreCreate(Sheet sheet, Table table) {
if (table.stream().noneMatch(record -> record.containsKey(TAX_LIABILITY))) {
// Брокеры являются агентами по акциям отечественных бумаг на мосбирже
sheet.setColumnHidden(TAX_LIABILITY.ordinal(), true); // нет обязательств
sheet.setZoom(92);
} else {
sheet.setZoom(89); // show all columns for 24-inch monitor for securities sheet
}
Expand Down

0 comments on commit 92d23b8

Please sign in to comment.