プロジェクト

全般

プロフィール

Vote #71519

完了

Enhanced PDF output for Issues list

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
40
issue_org_id:
10464
author_id:
52014
assigned_to_id:
0
comments:
10
status_id:
5
tracker_id:
3
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.

journals

--------------------------------------------------------------------------------
This is a patch rebased on trunk r9240.
--------------------------------------------------------------------------------
This is a full patch for r9244 which fixes conflict and source indents.

--------------------------------------------------------------------------------
Note 3 patch first row of second page height is broken.

!first-row.png!
--------------------------------------------------------------------------------
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*_

--------------------------------------------------------------------------------
Please create a patch to the *trunk*.
I rebased your patch to the trunk.
--------------------------------------------------------------------------------
I can make a patch only tomorrow at work.

About first row of second page ..
Change from (about line 333 in trunk):

<pre>
# 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

</pre>

To:

<pre>
# 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

</pre>

This should fix the result.
--------------------------------------------------------------------------------
Updated
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------


related_issues

relates,Closed,10554,Defect symbols when exporting tasks in pdf

Admin Redmine さんが4年以上前に更新

  • カテゴリPDF export_39 にセット
  • 対象バージョン1.4.0_40 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0