Patch #10464
Enhanced PDF output for Issues list
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | PDF export | |||
Target version: | 1.4.0 |
Description
Improvements:
1. Automatic calculation of the size of table columns depending on their content.
2. Automatic detection of columns alignment.
3. Output table header on each page.
Related issues
Associated revisions
pdf: enhanced issues list (#10464)
- Automatic calculation of the size of table columns depending on their content
- Output table header on each page
Contributed by Yuri Makarov.
History
#1
Updated by Yuri Makarov almost 11 years ago
- File example-1.pdf added
- File example-2.pdf added
- File example-3.pdf added
#2
Updated by Toshi MARUYAMA almost 11 years ago
- File pdf-r9240.diff
added
This is a patch rebased on trunk r9240.
#3
Updated by Toshi MARUYAMA almost 11 years ago
- File issues-pdf-r9244.diff
added
This is a full patch for r9244 which fixes conflict and source indents.
#4
Updated by Toshi MARUYAMA almost 11 years ago
- File grouped-issues.pdf added
- File first-row.png added
Note 3 patch first row of second page height is broken.
#5
Updated by Yuri Makarov almost 11 years ago
I can't test it now, my Redmine at work.
Some comments:
1. Comparing the diff's, I see in my pdf.rb line:
cv = issue.custom_values.detect {| v | ....
your version should be?:
cv = issue.custom_field_values.detect {| v | ....
2. Calculate the length of the text in my diff is based on the font page header. This is not correct. It almost does not affect the result, but leads to an increase in long columns of text. To correct this, use in def calc_col_width:
...
# by captions
pdf.SetFontStyle('B',8)
...
# by properties of issues
pdf.SetFontStyle('',8)
...
In this case, it may be necessary to add a constant of the column width for padding around the text, such as 5 mm.
col_padding = 5
col_width_min = query.columns.map {|v| pdf.GetStringWidth(v.caption) + col_padding}
...
x = pdf.GetStringWidth(w) + col_padding
...
n = pdf.GetStringWidth(v.rstrip) + col_padding
...
x = pdf.GetStringWidth(w) + col_padding
#6
Updated by Toshi MARUYAMA almost 11 years ago
Please create a patch to the trunk.
I rebased your patch to the trunk.
#7
Updated by Yuri Makarov almost 11 years ago
I can make a patch only tomorrow at work.
About first row of second page ..
Change from (about line 333 in trunk):
# make new page if it doesn't fit on the current one space_left = page_height - base_y - bottom_margin if max_height > space_left pdf.AddPage("L") base_x = pdf.GetX base_y = pdf.GetY render_table_header(pdf, query, col_width, row_height, col_id_width, table_width) end
To:
# make new page if it doesn't fit on the current one space_left = page_height - base_y - bottom_margin if max_height > space_left pdf.AddPage("L") render_table_header(pdf, query, col_width, row_height, col_id_width, table_width) base_x = pdf.GetX base_y = pdf.GetY end
This should fix the result.
#9
Updated by Terence Mill almost 11 years ago
+1
#10
Updated by Toshi MARUYAMA almost 11 years ago
- File pdf-issues-alignment.diff
added
- Status changed from New to Closed
- Target version set to 1.4.0
I committed r9246 to the trunk.
This commit is removed auto alignment.
I attach a patch for auto alignment.
I do not see the reason to change alignment.