Defect #5211

Gantt to PDF not working with subtasking

Added by Enderson Maia over 12 years ago. Updated over 9 years ago.

Status:ConfirmedStart date:2010-03-29
Priority:NormalDue date:
Assignee:-% Done:

70%

Category:Gantt
Target version:-
Resolution: Affected version:2.2.1

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

History

#1 Updated by Jeffrey Jones about 12 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?

#2 Updated by Jeffrey Jones about 12 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.

#3 Updated by Jeffrey Jones about 12 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.

#4 Updated by Jeffrey Jones about 12 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

#5 Updated by Mischa The Evil about 12 years ago

  • Category changed from UI to Gantt

#6 Updated by Daniel Felix over 9 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?

#7 Updated by Daniel Felix over 9 years ago

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

Also available in: Atom PDF