molten-trunk/molten5_withgrid/vendor/plugins/excel/lib/excel.rb
def build
	    	buffer = ""
		    xml = Builder::XmlMarkup.new(buffer)
		    xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" 
		    xml.Workbook({
		      'xmlns'      => "urn:schemas-microsoft-com:office:spreadsheet", 
		      'xmlns:o'    => "urn:schemas-microsoft-com:office:office",
		      'xmlns:x'    => "urn:schemas-microsoft-com:office:excel",    
		      'xmlns:html' => "http://www.w3.org/TR/REC-html40",
		      'xmlns:ss'   => "urn:schemas-microsoft-com:office:spreadsheet" 
		      }) do
	    
			      xml.Styles do
			       xml.Style 'ss:ID' => 'Default', 'ss:Name' => 'Normal' do
			         xml.Alignment 'ss:Vertical' => 'Bottom'
			         xml.Borders
			         xml.Font 'ss:FontName' => 'Arial'
			         xml.Interior
			         xml.NumberFormat
			         xml.Protection
			       end
			       xml.Style 'ss:ID' => 's22' do
			         xml.NumberFormat 'ss:Format' => 'General Date'
			       end
			      end
			      
			      for object in @worksheets
		      		# use the << operator to prevent the < > and & characters from being converted.
		      		# this will concat them together.
		      		if object[1] =='array'
		      		 xml << worksheetFromArray(object[0], object[2])
		            else
		             xml << worksheet(object[0], object[1], object[2])
		            end
			      end # for records
			    end
			    
	    return xml.target! 
	  end
# Returns the Excel workbook in XML format.
# In the controller, set the content type appropriately to send this back.
#
# Example: 
#     headers['Content-Type'] = "application/vnd.ms-excel" 
#     render_text(e.build)

Returns the Excel workbook in XML format.
In the controller, set the content type appropriately to send this back.


Returns the Excel workbook in XML format . In the controller set the content type appropriately to send this back .
def build
	    	buffer = ""
		    xml = Builder::XmlMarkup.new(buffer)
		    xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" 
		    xml.Workbook({
		      'xmlns'      => "urn:schemas-microsoft-com:office:spreadsheet", 
		      'xmlns:o'    => "urn:schemas-microsoft-com:office:office",
		      'xmlns:x'    => "urn:schemas-microsoft-com:office:excel",    
		      'xmlns:html' => "http://www.w3.org/TR/REC-html40",
		      'xmlns:ss'   => "urn:schemas-microsoft-com:office:spreadsheet" 
		      }) do
			      xml.Styles do
			       xml.Style 'ss:ID' => 'Default', 'ss:Name' => 'Normal' do
			         xml.Alignment 'ss:Vertical' => 'Bottom'
			         xml.Borders
			         xml.Font 'ss:FontName' => 'Arial'
			         xml.Interior
			         xml.NumberFormat
			         xml.Protection
			       end
			       xml.Style 'ss:ID' => 's22' do
			         xml.NumberFormat 'ss:Format' => 'General Date'
			       end
			      end
			      for object in @worksheets
		      		if object[1] =='array'
		      		 xml << worksheetFromArray(object[0], object[2])
		            else
		             xml << worksheet(object[0], object[1], object[2])
		            end
			      end 
			    end
	    return xml.target! 
	  end
def build buffer = "" xml = Builder :: XmlMarkup . new ( buffer ) xml . instruct! :xml , :version => "1.0" , :encoding => "UTF-8" xml . Workbook ( { 'xmlns' => "urn:schemas-microsoft-com:office:spreadsheet" , 'xmlns:o' => "urn:schemas-microsoft-com:office:office" , 'xmlns:x' => "urn:schemas-microsoft-com:office:excel" , 'xmlns:html' => "http://www.w3.org/TR/REC-html40" , 'xmlns:ss' => "urn:schemas-microsoft-com:office:spreadsheet" } ) do xml . Styles do xml . Style 'ss:ID' => 'Default' , 'ss:Name' => 'Normal' do xml . Alignment 'ss:Vertical' => 'Bottom' xml . Borders xml . Font 'ss:FontName' => 'Arial' xml . Interior xml . NumberFormat xml . Protection end xml . Style 'ss:ID' => 's22' do xml . NumberFormat 'ss:Format' => 'General Date' end end for object in @worksheets if object [ 1 ] == 'array' xml << worksheetFromArray ( object [ 0 ] , object [ 2 ] ) else xml << worksheet ( object [ 0 ] , object [ 1 ] , object [ 2 ] ) end end end return xml . target! end
Returns the Excel workbook in XML format.
Returns the Excel workbook in XML format .
# use the << operator to prevent the < > and & characters from being converted.
 # this will concat them together.
 # for records
