Skip to content
Snippets Groups Projects
Commit 75732835 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #146 - report: set size of columns

parent 4f0432e2
No related branches found
No related tags found
1 merge request!150merge v1_3_1 into master
......@@ -2,24 +2,31 @@ package de.deadlocker8.budgetmaster.logic.report;
public enum ColumnType
{
POSITION("Nr."),
DATE("Datum"),
REPEATING("Wiederholend"),
CATEGORY("Kategorie"),
NAME("Name"),
DESCRIPTION("Notiz"),
RATING("Bewertung"),
AMOUNT("Betrag");
POSITION("Nr.", 1),
DATE("Datum", 2),
REPEATING("Wiederholend", 1),
CATEGORY("Kategorie", 3),
NAME("Name", 3),
DESCRIPTION("Notiz", 3),
RATING("+/-", 1),
AMOUNT("Betrag", 2);
private String name;
private float proportion;
private ColumnType(String name)
private ColumnType(String name, float proportion)
{
this.name = name;
this.proportion = proportion;
}
public String getName()
{
return name;
}
public float getProportion()
{
return proportion;
}
}
\ No newline at end of file
......@@ -70,7 +70,13 @@ public class ReportGenerator
if(numberOfColumns > 0)
{
PdfPTable table = new PdfPTable(numberOfColumns);
float[] proportions = new float[numberOfColumns];
for(int i = 0; i < columnOrder.getColumns().size(); i++)
{
proportions[i] = columnOrder.getColumns().get(i).getProportion();
}
PdfPTable table = new PdfPTable(proportions);
table.setWidthPercentage(tableWidth);
Font font = new Font(FontFamily.HELVETICA, 8, Font.NORMAL, GrayColor.BLACK);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment