Forums » Support and troubleshooting » My Generated and Consolidates reports do not work
Hello there, so far so good i havent had issues with viewing my pdf reports. But i just noticed that i cant view the full generated result (i.e http://localhost:3000/exam/generated_report4?student=376&type=general) and the consolidated report (http://localhost:3000/exam/consolidated_exam_report_pdf?exam_group=8)

This is the error i get when i try to view any of the links stated above:
Failed to execute C:/schoolname/pdf/wkhtmltopdf.exe: Invalid argument

RAILS_ROOT: C:/schoolname
Application Trace | Framework Trace | Full Trace

C:/schoolname/vendor/plugins/wicked_pdf/lib/win32_pdf_renderer.rb:14:in `pdf_from_string'
C:/schoolname/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:54:in `make_pdf'
C:/schoolname/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:65:in `make_and_send_pdf'
C:/schoolname/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:17:in `render'
C:/schoolname/app/controllers/exam_controller.rb:400:in `generated_report4_pdf'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
C:/RailsInstaller/Ruby187/lib/ruby/1.8/benchmark.rb:308:in `realtime'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
C:/RailsInstaller/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'

Its funny becos this same path "C:/schoolname/pdf/wkhtmltopdf.exe" works with other PDF reports.

Please any help would be appericiated cos i need the solution like yesterday.
Hmm, I Never came across this issue. Try edit the source file, Remove ",:page_size=> 'A3' " line 233 of exam_controller.rb
and restart your server.
Hello Soorajb thanks so much for responding. Well, i did as u said but i got the following error:
SyntaxError in ExamController#generated_report

C:/schoolname/app/controllers/exam_controller.rb:236: syntax error, unexpected kEND
C:/schoolname/app/controllers/exam_controller.rb:245: syntax error, unexpected kDO_BLOCK, expecting kEND
render(:update) do |page|
^
C:/schoolname/app/controllers/exam_controller.rb:246: syntax error, unexpected tSTRING_BEG, expecting kEND
... page.replace_html 'subject-select', :partial=>'su...
^
C:/schoolname/app/controllers/exam_controller.rb:246: syntax error, unexpected ',', expecting kEND
...replace_html 'subject-select', :partial=>'subject_select'
^
C:/schoolname/app/controllers/exam_controller.rb:288: syntax error, unexpected kDO_BLOCK, expecting kEND
render(:update) do |page|
^
C:/schoolname/app/controllers/exam_controller.rb:289: syntax error, unexpected tSTRING_BEG, expecting kEND
page.replace_html 'report_type',:partial=>'report_type'
^
C:/schoolname/app/controllers/exam_controller.rb:289: syntax error, unexpected ',', expecting kEND
page.replace_html 'report_type',:partial=>'report_type'
^
C:/schoolname/app/controllers/exam_controller.rb:317: syntax error, unexpected kDO_BLOCK, expecting kEND
@grouped_exams.each do |x|
^
C:/schoolname/app/controllers/exam_controller.rb:318: syntax error, unexpected tCONSTANT, expecting kEND
@exam_groups.push ExamGroup.find(x.exam_group_id)
^
C:/schoolname/app/controllers/exam_controller.rb:326: syntax error, unexpected kDO_BLOCK, expecting kEND
student_electives.each do |elect|
^
C:/schoolname/app/controllers/exam_controller.rb:327: syntax error, unexpected tCONSTANT, expecting kEND
elective_subjects.push Subject.find(elect.subject_id)
^
C:/schoolname/app/controllers/exam_controller.rb:330: syntax error, unexpected kELSE, expecting $end

Please what else can i do, i really need to get it to work. Thanks
Hello again, sorry i didn't remove the closing character "," above line 233 that was why it gave me the error. Now the consolidated_exam_report_pdf is working but the generated_report4 is not working ( any other ideas ). Also please how do i get the consolidated_exam_report_pdf to display on landscape view because on Portrait it is not displaying all the subjects.
The argument --orientation 'Landscape' throws an error and needs to be replaced by -O landscape. To do this change the make_option function in the file {FEDENA_ROOT}\vendor\plugins\wicked_pdf\lib\wicked_pdf.rb to the following:

def make_option(name, value, type=:string)
if name == "orientation" and value == "Landscape"
"-O landscape "
else
"--#{name.gsub('_', '-')} " + case type
when :boolean then ""
when :numeric then value.to_s
when :hf then "#{value}"
else "'#{value}'"
end + " "
end
end