Thanks to answer.
But i am quite new for rails programming.
file_location = file_path + "/" + file_name + ".pdf"
pdf = Prawn::Document.new(:template => file_location, :skip_page_creation => true) do
start_new_page(:template => file_path)
end
#data is 2D array
pdf.indent(10) do
pdf.table(data, :header => true ) do
rows(0..data.length).style(:border_width => 1, :align => :center).size=12
row(0).style(:background_color => '01d4ab', :border_width => 1,:align => :center, :font_style => :bold, :text_color =>'000000')
if change_config != nil
change_config.each do |c|
row(c).style(:background_color => 'FFFF00', :border_width => 1,:align => :center, :font_style => :bold)
end
end
end
pdf.number_pages "Page <page> of <total>", :at => [432, -4], :width => 100, :text_color =>'00ff00'
pdf.render_file file_location
end
I want to fit that code .please suggest.