Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Export to PDF #18

Open
darkwolf-zz opened this issue Jan 23, 2010 · 6 comments
Open

Export to PDF #18

darkwolf-zz opened this issue Jan 23, 2010 · 6 comments

Comments

@darkwolf-zz
Copy link

Hi!, when I try to export reports to pdf I can't do it.
I'm not sure if I need any gem to do it or it's a bug.
And I noticed when I do the search, the PDF icon is not displayed as in the flash tutorial.

I installed CentOS v5.4, mysql 5.0.77-4.el5_4.1, ruby 1.8.5

Thanks for all.

@darkwolf-zz
Copy link
Author

this is complete error:

Processing EventsController#show to pdf (for 192.168.1.100 at 2010-01-25 11:18:54) [GET]
Parameters: {"format"=>"pdf", "action"=>"show", "id"=>"1,532", "controller"=>"events"}
Rendering events/show

ActionView::TemplateError (undefined method `header' for #Prawn::Document:0xb72b8a74) on line #38 of app/views/events/show.pdf.prawn:
35: ### END
36:
37: ### Start Of Data
38: pdf.header [pdf.margin_box.left, pdf.margin_box.top + 20] do
39: pdf.text "- #{Time.now.strftime('%A, %B %d, %Y')} - #{@event.sig.sig_name}. -", :size => 7, :align => :center, :style => :italic, :color => 'black'
40: pdf.move_down 2
41: pdf.stroke_horizontal_rule

/usr/lib/ruby/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/graphics/color.rb:68:in `method_missing'
app/views/events/show.pdf.prawn:38:in `_run_prawn_app47views47events47show46pdf46prawn'
app/controllers/events_controller.rb:16:in `show'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering /errors/500.html.erb (500 Internal Server Error)

@djcas9
Copy link
Owner

djcas9 commented Feb 4, 2010

@Darkwolf this is a strange error. What version of prawn do you have installed?

gem list

@darkwolf-zz
Copy link
Author

Hi mephux, thanks for answer.
I have installed : prawn (0.7.1).
In other pc, I tried to install rails v 2.3.2 (gem install rails -v=2.3.2 ), and changed it in environment.rb (RAILS_GEM_VERSION = ), but it's the same error.

[root@ids /]# gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
archive-tar-minitar (0.5.2)
Ascii85 (1.0.0)
color (1.4.0)
dbi (0.4.3)
deprecated (2.0.1)
fastthread (1.0.7)
gemcutter (0.3.0)
hoe (2.5.0)
json_pure (1.2.0)
passenger (2.2.9)
pdf-reader (0.8.2)
pdf-writer (1.1.8)
prawn (0.7.1)
prawn-core (0.7.1)
prawn-format (0.2.3)
prawn-layout (0.7.1)
prawn-security (0.7.1)
rack (1.1.0, 1.0.1)
rails (2.3.5)
rake (0.8.7)
rubyforge (2.0.3)
rubygems-update (1.3.5)
transaction-simple (1.4.0)
[root@ids /]#

@andreshans
Copy link

I got same error... and i think the error its about the prawn version we are using.

http://wiki.github.com/sandal/prawn/changelog
This: "removed header() and footer() methods, use Prawn::Document#repeat
instead."

@andreshans
Copy link

workaround:
gem install --version=0.6.2 prawn prawn-core (it will take a long time)
then... gem list and uninstall the older version with:
gem uninstall --version=x.x.x praw
gem uninstall --version=x.x.x praw-core
and when you get in the browser "File not found xxxxx.pdf" just hit refesh.
and remember: it just a workaround

@Roon3y
Copy link

Roon3y commented Nov 1, 2010

i tried what says up^^
but still wouldnt work for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants