Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ruby Ruportʵ¼ù—±¨±í²ÎÊýʵÏÖ

´ËÀý×ÓÔÚ Ruby Ruportʵ¼ù—¼òµ¥±¨±íϵͳ ¼° Ruby Ruportʵ¼ù—ÖÐÎÄPDF±¨±íÖ®PRAWN  µÄ»ù´¡ÉϽøÐÐÍêÉÆ£¬Ìí¼ÓÁ˶Ա¨±í²ÎÊýµÄÉè¼Æ¼°ÊµÏÖ¡£
Ò»¡¢´´½¨Êý¾Ý±íreport_parameters
create table report_parameters
(report_parameter_id integer not null auto_increment,
report_execute_id integer not null,
parameter_name varchar(240),
parameter_value varchar(240),
primary key "report_parameter_id")
ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
¶þ¡¢ÐÞ¸Äcontrollers/ReportExecutionsController.rb
½«report_parametersµÄ»ù±¾²Ù×÷Ìí¼Óµ½report_executions½çÃæ
class ReportExecutionsController < ApplicationController
# GET /report_executions
# GET /report_executions.xml
Ruport::Formatter::Template.create(:simple) do |format|
eval("format.page = {:layout => :landscape}
format.grouping = {:style => :separated}
format.text = {:font_size => 20,:justification => :center}
format.table = {:font_size => 10,:heading_font_size => 10,:maximum_width => 720,:width => 720}
format.column = {:alignment => :center}
format.heading = {:alignment => :center,:bold => true,:font_size=>10}")
end
def show_report_details
report_execution = ReportExecution.find_by_execute_code(params[:report_execute_code])
@report_execute_code = params[:report_execute_code]
puts "======================ÏÔʾ±¨±í²ÎÊý======================="
@report_params = ReportExecution.find_by_sql("SELECT * from report_parameters WHERE report_execute_id= #{report_execution.report_execute_id}")
@report_params.each do |t|
puts "#{t.parameter_name}: #{t.parameter_value}"
end
puts"========================================================"
render :action => "execute"
end
def output_report
puts "----------------------------Output Report Code: #{params[:execution_code]}"
report_execution = ReportExecution.find_by_execute_code(params[:execution_code])
rep


Ïà¹ØÎĵµ£º

RUBYʵ¼ù—´øÃÜÂë¼ÓÃܵÄÓû§´´½¨¼°ÐÞ¸Ä

¿ª·¢»·¾³
Ruby: Ruby1.9.1
Rails: Rails2.3.5
Mysql:Mysql5.0.9
Driver:mysql-2.8.1-x86-mingw32.gem
IDE:Rubymine2.0.1
Ò»¡¢´´½¨Êý¾Ý±íUsers
ÀûÓÃRubyMine×Ô´øµÄScaffold¹¤¾ß´´½¨Êý¾Ý±íUsers£¬Ò²¿ÉÒÔÊÖ¶¯´´½¨
¶þ¡¢´´½¨ControllerºÍView
RubyÏîÄ¿—>ÓÒ¼ü—>Create Model
Íê³Éºó½«×Ô¶¯Éú³ÉÏàÓ¦µÄÎ ......

ruby Bignum Dir ѧϰ

Bignum
+        ¼Ó
-        ¼õ
*        ³Ë
/        ³ý
**        Ö¸Êý²Ù×÷2**2 Òâ˼ÊÇ2µÄƽ·½
<=>        ´óÓÚ, ......

Ruby Ruportʵ¼ù—¼òµ¥±¨±íϵͳ

¿ª·¢»·¾³
OS:WindowsXP
Ruby:Ruby1.8.7
Rails:Rails2.3.5
Mysql:Mysql5.0.9
IDE:Rubymine2.0.1
×¼±¸¹¤×÷£º
°²×°ÒÔÏÂgem°ü
gem install ruport
gem install ruport-util
gem install acts_as_reportable
±¾ÀýÉè¼ÆµÄ±¨±íϵͳ¹¤×÷Ô­ÀíÈçͼ£¨´¿Êô¸öÈËÀí½â£©£¬ÒÔProducts±íΪÀý£º
½ÓÏÂÀ´ÊµÏÖµÄÀý×Ó½«ÀûÓÃeval·½·¨ÊµÏ ......

Ruby Ruportʵ¼ù—ÖÐÎÄPDF±¨±íÖ®PRAWN

FPDFÄÜÖ§³ÖPDFµÄÖÐÎÄ´òÓ¡£¬È»¶øÈ´´æÔÚ²»ÉٵIJ»ÈçÒâÖ®´¦£¬¾ÝÎÒĿǰµÄʹÓã¬×ܽá³ö¼¸µã£º
1£©FPDFÌṩµÄPdf_Chinese×ÖÌ壬½«GBÕâÖÖ×ÖÌåдÈëÁË´úÂëÖУ¬ÈôÎÒÃÇÏ£ÍûÒýÈëÆäËûµÄÖÐÎÄ×ÖÌ壬Ôò²»ÄÜ·½±ãµØÊ¹ÓÃ
2£©FPDFÊä³öµÄÊý×Ö²¢²»ÃÀ¹Û£¬²»ÈçRuport::Formatter::PDF×Ô´øµÄ×ÖÌå
3£©FPDFÌṩµÄ·½·¨²¢²»¶à£¬¶ÔÓÚÒ»°ãµÄ±¨±í´òÓ¡£¬Óõ ......

Installing Ruby 1.8.6 from Source on Ubuntu

Installing Ruby from source is my preferred method, although in Ubuntu Feisty you can supposedly install it with apt-get install ruby
now. Here’s the essential packages needed to get a source build working right though and the process I just went through:
sudo apt-get install build-essentia ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ