Defect #6348

Gantt chart PDF rendering errors

Added by Eric Davis about 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2010-09-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Gantt
Target version:1.1.0
Resolution:Fixed Affected version:

Description

When rendering the new Gantt chart (#6276) with a large chart, the PDF export gets off and creates multiple almost-empty pages.

Unfortunately, it looks like the older Gantt chart wasn't exporting PDFs correctly either so this section might need to be rethought.


Related issues

Related to Redmine - Feature #6276: Gantt Chart rewrite Closed 2010-09-03

Associated revisions

Revision 4472
Added by Jean-Philippe Lang almost 7 years ago

Gantt: iterate over all objects only once for html and pdf rendering (#6348).

Revision 4474
Added by Jean-Philippe Lang almost 7 years ago

Fixes gantt PDF pagination problem (#6348).

Revision 4475
Added by Jean-Philippe Lang almost 7 years ago

Gantt: fixes position of line in pdf (#6348).

History

#1 Updated by Mischa The Evil about 7 years ago

  • Category changed from Issues to Gantt

#2 Updated by Eric Davis about 7 years ago

  • Assignee deleted (Eric Davis)

I am stepping down from working on Redmine. If someone else is interesting in working on this issue, feel free to reassign it to them.

Eric Davis

#3 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from 7 to New

The way the new gantt chart generates PDF (all subjects then all lines) makes it hard, if not impossible, to fix without some refactoring.

#4 Updated by Greg Mefford almost 7 years ago

From studying the existing code for rendering Gantt PDFs, it looks like it's a pagination issue where a possible solution would be to pre-compute what you want to render, paginate, then render each page. This is instead of just rendering as you go, which it seems is causing the overflow as soon as it's too much for a single page.

I'm going to look into it further, but don't let that stop someone else from fixing it; I can't guarantee I'll find the time to actually fix the bug.

#5 Updated by Greg Mefford almost 7 years ago

I've started working on a patch that seems to be doing the trick. It's not quite done, but perhaps I can finish it tomorrow.
This gantt code really feels like it could use some refactoring, but I'm having some success hacking in the pagination.

#6 Updated by Greg Mefford almost 7 years ago

  • Status changed from New to Resolved

That Gantt code could use some more attention, but in the mean time, here is some code that generates proper PDFs with a large number of rows (like more than 50).

I've sent a pull request to edavis10 on Github, but in case he doesn't have time and someone else wants to integrate, here is a link:
https://github.com/GregMefford/redmine/commit/900f8dad375a8f218a19c72b48eecde521c8026a

#7 Updated by Jean-Philippe Lang almost 7 years ago

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

I fixed the problem in a similar way as your patch does, in r4474, thanks. This change takes part in some refactoring that I'm doing in order to get more reasonable response times for an average cross-project chart with a few hundreds issues.

Also available in: Atom PDF