Patch #3614

Export to PDF/CSV ignoring custom queries and HTML query display problems

Added by Alex Mendes Matt Keniston over 8 years ago. Updated over 6 years ago.

Status:ClosedStart date:2009-07-14
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Redmine Development build

This is a solution to Defect #1190
It patches the bugs in 'Export to PDF' and 'Export to CSV' on the Issue page.

Previously, Redmine did not honor custom queries when exporting to PDF/CSV. Instead, it would either print minimal default columns(PDF) or print all the columns(CSV).

This patch, correctly, displays the columns specified by the custom queries.

Additionally, we fixed an HTML display issue on the Issues page in redmine. Of what's fixed
1.) Custom fields will now wrap
2.) Custom text based fields are now left aligned

export_issues_to_pdf_csv.diff Magnifier (32.3 KB) Alex Mendes Matt Keniston, 2009-07-14 17:07

export_issues_to_pdf_csv_r2823.diff Magnifier (28.2 KB) Chris Grieger, 2009-07-29 13:18

export_issues_to_pdf_csv_r2823_win32.diff Magnifier (29 KB) Chris Grieger, 2009-07-29 13:30

wrap-lines-on-pdf-export-rm1_0_4.patch Magnifier - Patch for Redmine 1.0.4 (25.1 KB) Chrisitian Noack, 2011-02-01 17:15


Related issues

Related to Redmine - Defect #1190: Custom querry 'Export to PDF' ignores field selection Closed 2008-05-06

History

#1 Updated by Abdul Nafay over 8 years ago

Hi, i am new to Redmine. I need this feature bad but i dont know how to place this .diff file in Redmine root directory. From what i know i have to patch this .diff file with original. I am using TortoiseSVN but i can't file the original file to patch with. If i am not in the right direction please point out and let me know how to exactly get this fix working. I am using windows btw.

Much Appreciated!

AN

#2 Updated by Dirk Schmidt over 8 years ago

In which release will be the feature included?

#3 Updated by Alex Mendes Matt Keniston about 8 years ago

To apply the .diff file see
http://www.redmine.org/wiki/redmine/Patch

Note that you will need to download the Patch application if you are using Windows.
You also need to use Subversion(svn) to retrieve the Redmine Development build.

#4 Updated by Abdul Nafay about 8 years ago

Thanks Alex,

Can you or somebody explain in a bit more step-by-step detail. I understand what you're saying here but it is just not working out for me. I am new to this and i would really appreciate if you could explain this in a bit more detail. I also dont understand the SVN part. Are you stating i have to download the SVN software? Y would i need to retrieve the Redmine Development Kit.

Thank you for your help!

AN

#5 Updated by Abdul Nafay about 8 years ago

1) Downloaded patch program for windows. And from cmd, i went to directoy where redmine is installed (apps, config, test etc folders). Did command "c:\bin\patch.exe -p0 < export_issues_to_pdf_csv.diff" This gave me a kind of strange statement that there is garbage in the file, something like this. Btw my .diff file was in the folder where patch.exe application exists. After i failed here, i explored TortoiseSVN.

2) Alex Mendes told me that i have to use SVN to retrieve Redmine development build. Not sure why, I used Tortoise SVN and checkout svn://rubyforge.org/var/svn/redmine/trunk . Files were downloaded to a new folder i created. I don't know what to do afterwards with all these files.

How can i get this patch working. I would really really appreciate if somebody could go out of way and explain it in detail how to patch in windows. I searched everywhere but could not locate a single article explaining this. Everywhere i looked it was related to a specific tool. Its disturbing that the patch instructions on this portal are just not useful for newbies.

Looking forward to your help. I'll appreciate it. Thanks!

Regards,

AN

#6 Updated by Dirk Schmidt about 8 years ago

Hi Alex,

sorry for asking again but it would be very helpful for us to know in which target version the patch will be merged.
Could you give us this information?

Thanks in advance.

Regards,

Dirk

#7 Updated by Chris Grieger about 8 years ago

I updated the patch to make it working for the current revision, as there were some errors, when trying to apply the patch.

#8 Updated by Chris Grieger about 8 years ago

This file is for Windows users. It has LF characters converted into CRLF, so the w32 version of patch doesn't fail.

#9 Updated by Alex Mendes Matt Keniston about 8 years ago

The initial fix that we wrote was for the Redmine Development Version from
svn co http://redmine.rubyforge.org/svn/trunk redmine

But it can just as easily be used for the latest stable version by removing the group related code as Chris Grieger appears to have done.

#10 Updated by Jean-Philippe Lang about 8 years ago

  • Status changed from Resolved to Closed

Fixed in r2841.

#11 Updated by Romuald Vandepoel almost 8 years ago

  • Status changed from Closed to Reopened

guys, I am running 8.6 and this is not fixed at all.
also, I can not patch from this release with the supplied diff. what are the possibilities?

#12 Updated by Jean-Philippe Lang almost 8 years ago

  • Status changed from Reopened to Closed

See #1190.

#13 Updated by Chrisitian Noack over 6 years ago

I've managed to modify the last patch called export_issues_to_pdf_csv.diff by Alex Mendes Matt Kenisto to work with RubyMine 1.0.4 stable. You find my patch file (wrap-lines-on-pdf-export-rm1_0_4.patch) attached. It also contains some useless reformatting which my IDE (RubyMine) did. I'm sorry for that.

Best regards,

Christian

#14 Updated by Luis Serrano Aranda over 6 years ago

Chrisitian very good patch, it would be possible to put the project name in all footers?

thanks in advance

#15 Updated by Luis Serrano Aranda over 6 years ago

Luis Serrano Aranda wrote:

Chrisitian very good patch, it would be possible to put the project name in all footers?

thanks in advance

I removed the part of the function def gantt_to_pdf now is in the gantt helper (redmine/lib/redmine/helpers/gantt.rb)

And add in pdf.rb
Line 33: + attr_accessor :footer_title

Line 120: - Cell(0, 5, @footer_title, 0, 0, 'L')
+ Cell(0, 5, @footer_title + ' (' + @footer_date + ')', 0, 0, 'L')

Line 135: + pdf.footer_title = title
Line 261: + pdf.footer_title = ("#{issue.project} - ##{issue.tracker} #{issue.id}")

And in gantt.rb

Line 591: + pdf.footer_title = ("#{l(:label_gantt)} #{project}")

Also available in: Atom PDF