Project

General

Profile

Actions

Defect #5211

open

Gantt to PDF not working with subtasking

Added by Enderson Maia over 14 years ago. Updated almost 12 years ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Gantt
Target version:
-
Start date:
2010-03-29
Due date:
% Done:

70%

Estimated time:
Resolution:
Affected version:

Description

When export a gantt chart to PDF, there's no black bar for the parent-issue, and subtasks are not idented.

Since the limitation of characters for the issue title in PDF is shorter than in HTML, maybe instead of identing you could use symbols for sub-levels.

# Parente Task
+ 1st level subtask
- 2nd level subtask
. 3rd level subtask
Actions #1

Updated by Jeffrey Jones over 14 years ago

Confirmed with 1.0-RC1

I would stick to the spaces as it is just easier to visualize. Maybe just two spaces per indentation?

Actions #2

Updated by Jeffrey Jones over 14 years ago

Simple quick and dirty fix.

in lib/redmine/export/pdf.rb, find the # Tasks comment then change the following (about 6 lines down)

if i.is_a? Issue
  text = "#{i.tracker} #{i.id}: #{i.subject}" 
else

to
if i.is_a? Issue
  text << (" " * i.level)
  text << "#{i.tracker} #{i.id}: #{i.subject}" 
else

that will give you one space of indentation per level.

Actions #3

Updated by Jeffrey Jones over 14 years ago

To change the colour of parent tasks change the following (Near the bottom of the file).

l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
l_width ||= 0

pdf.SetX(subject_width + i_left)
pdf.SetFillColor(100,100,100) # CHANGE HERE

pdf.Cell(i_width, 2, "", 0, 0, "", 1)
l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
l_width ||= 0

pdf.SetX(subject_width + i_left)

if i.leaf?
  pdf.SetFillColor(200,200,200) # Normal colour
else
  pdf.SetFillColor(100,100,100) # Parent colour, change to fit your preferences
end

pdf.Cell(i_width, 2, "", 0, 0, "", 1)

Note that this doesn't put the downward pointy bits (That is a technical term) on the parent bars, just changes the colour which is good enough for me at the moment.

Actions #4

Updated by Jeffrey Jones over 14 years ago

  • % Done changed from 0 to 70

I suppose those two fixes up solves most of the problem.

Just tests and the downward pointy bits left

Actions #5

Updated by Mischa The Evil about 14 years ago

  • Category changed from UI to Gantt
Actions #6

Updated by Daniel Felix almost 12 years ago

  • Status changed from New to Confirmed

I could confirm that this isn't fixed in Redmine 2.2.1.

Any news on this?

Actions #7

Updated by Daniel Felix almost 12 years ago

  • Affected version (unused) set to 2.2.1
  • Affected version set to 2.2.1
Actions

Also available in: Atom PDF