Feature #5634

Export issue to PDF does not include Subtasks and Related Issues

Added by Daniel Netzer over 7 years ago. Updated about 6 years ago.

Status:ClosedStart date:2010-06-02
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

100%

Category:Issues
Target version:1.3.0
Resolution:Fixed

Description

Using Redmine trunk, exporting an issue to PDF misses the new subtaks (#443) and also related task in the PDF export. (source:trunk/lib/redmine/export).

pdf.rb_1.0.5.patch Magnifier - patch against 1.0.5 (4.16 KB) Bernhard Furtmueller, 2011-01-28 19:56

0001-Forward-port-of-Export-issue-to-PDF-does-not-include.patch Magnifier - patch against trunk (4.43 KB) Bernhard Furtmueller, 2011-01-28 20:57

pdf.png - pdf view of tracker with related issues, parents and childs (57.1 KB) Bernhard Furtmueller, 2011-02-07 09:39

0001-Forward-port-of-Export-issue-to-PDF-does-not-include_2.patch Magnifier - patch against 1.2-stable (3.47 KB) Bernhard Furtmueller, 2011-08-26 19:30

r7764.patch Magnifier (3.2 KB) Toshi MARUYAMA, 2011-11-11 11:00

pdf.rb_r7782.patch Magnifier (3.31 KB) Jun NAITOH, 2011-11-12 00:35


Related issues

Related to Redmine - Patch #8617: Indent subject of subtask ticket in exported issues PDF Closed 2011-06-15
Duplicated by Redmine - Feature #9535: Export PDF with subtask Closed 2011-11-07

Associated revisions

Revision 7787
Added by Toshi MARUYAMA about 6 years ago

pdf: add ancestor issues at head of issue pdf (#5634)

Contributed by Bernhard Furtmueller and Jun NAITOH.

Revision 7788
Added by Toshi MARUYAMA about 6 years ago

pdf: add subtasks and related issues at issue pdf (#5634)

Contributed by Bernhard Furtmueller and Jun NAITOH.

Revision 7845
Added by Jean-Philippe Lang about 6 years ago

Omit subtasks/related issues sections when empty on PDF export (#5634).

Revision 7965
Added by Toshi MARUYAMA almost 6 years ago

pdf: expand relational issues status column width of issue pdf (#5634)

History

#1 Updated by Eric Davis over 7 years ago

  • Tracker changed from Defect to Feature

#2 Updated by Daniel Netzer over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 90

Thanks to Heiko this solves it for me:

        i = 0
        issue.relations.select { |r| r.other_issue(issue).visible? }.each do |relation|
          if i == 0
            pdf.SetFontStyle('B',9)
            pdf.Cell(35,5, l(relation.label_for(issue)) + ":", "LT")
            pdf.SetFontStyle('', 9)
            pdf.MultiCell(155,5, "#{relation.other_issue(issue).project} - #{relation.other_issue(issue).tracker} # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}", "RT")
          else
            pdf.SetFontStyle('B',9)
            pdf.Cell(35,5, l(relation.label_for(issue)) + ":", "L")
            pdf.SetFontStyle('', 9)
            pdf.MultiCell(155,5, "#{relation.other_issue(issue).project} - #{relation.other_issue(issue).tracker} # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}", "R")
          end
          i += 1
        end

insert above after the following block:

        for custom_value in issue.custom_field_values
          pdf.SetFontStyle('B',9)
          pdf.Cell(35,5, custom_value.custom_field.name + ":","L")
          pdf.SetFontStyle('',9)
          pdf.MultiCell(155,5, (show_value custom_value),"R")
        end

in lib/redmine/export/pdf.rb

#3 Updated by Bernhard Furtmueller almost 7 years ago

I took this patch and enhanced it to really show subtasks, also ancestors are shown on top

#5 Updated by Bernhard Furtmueller almost 7 years ago

#6 Updated by Xiaobing Sun over 6 years ago

Thanks you for the fix.
Open it can be adopted to the trunk.

The code can work on 1.1.2.
For 1.2.0, it need a little change.

#7 Updated by Etienne Massip over 6 years ago

  • Status changed from Resolved to New
  • Target version set to Candidate for next major release

#9 Updated by yannick quenec'hdu about 6 years ago

Hi Bernhard,

Your Patch need a little change to work with Redmine 1.2.1

Thank for your patch

Cheers
Yannick

#10 Updated by Toshi MARUYAMA about 6 years ago

  • Status changed from New to 7
  • Assignee set to Toshi MARUYAMA

#11 Updated by Jun NAITOH about 6 years ago

Hi, I rewritie note-8 patch for trunk, now.
I think to note-8 patch have some probrem.
If you wait some day, so I will post new patch.
Please wait.

#12 Updated by Toshi MARUYAMA about 6 years ago

This is a patch for r7764.

#13 Updated by Toshi MARUYAMA about 6 years ago

Note 12 patch line 288-298 has smart indents.
But, line 364-407 indents and truncating is ugly.
Could you rewrite?

#14 Updated by Jun NAITOH about 6 years ago

Toshi MARUYAMA wrote:

Note 12 patch line 288-298 has smart indents.

I rewrite now.

  • delete ancestor.project. Because ancestor.project is identical with issue's project.
  • delete issue.subject by title. Because it is duplicate in the Cell.
  • add limit for nesting.

But, line 364-407 indents and truncating is ugly.
Could you rewrite?

Sorry, I tried rewrite 364-407 with MultiCell now. But I give up use MultiCell.
If I use MultiCell, so I need MovePage(back to before page) method. But TCPDF didn't have this method.

I think to your implementation isn't best, but better.

I added to limit for nesting.

I attached rewrite patch for r7782.

#15 Updated by Toshi MARUYAMA about 6 years ago

  • Subject changed from Export issue to PDF does not include Subtaks and Related Issues to Export issue to PDF does not include Subtasks and Related Issues

#16 Updated by Toshi MARUYAMA about 6 years ago

  • Target version changed from Candidate for next major release to 1.3.0
  • % Done changed from 90 to 100

I committed note 14 patch in trunk r7787 and r7788.
I changed one line.
source:trunk/lib/redmine/export/pdf.rb@7788#L365

#17 Updated by Jun NAITOH about 6 years ago

Thank you!

#18 Updated by Jean-Philippe Lang about 6 years ago

  • Status changed from 7 to Closed
  • Resolution set to Fixed

I think we can close now.

Also available in: Atom PDF