Setting the Excel workbook name through my Ruby Code

Hi all,
I want to change the Workbook name of my excel when i do a Export to
excel.Rite now the excel “file name” and “tab name” is same.
I am not using any gem or plugin for export.I am using The normal


format.xls do
headers[‘Content-Disposition’] = “attachment; filename=
name.xls”
render :layout => ‘report’
end

Please tell me the solution for changing the bottom tab name.

Hi Ankit,

from what I see, you’re probably using the “spreadsheet” gem in rails,
isn’t it ?

Take a look at the gem’s documentation :
http://spreadsheet.rubyforge.org/ , maybe you’ll find what you need
there.

Cheers,
zimbatm

On 1/16/2011 11:27 AM, Ankit G. wrote:

Hi
Thanks For replying… but the thing is as i told i am NOT USING any
gem/plugin for export of excel.I am using the default feature provided
by rails,and i am controlling the excel with the CSS by defining the
mso(microsoft office) library of styling.My requirement is to change the
worksheet tab name to the desired name…By default what happens is that
the filename and worksheet name is same…
Rails provides absolutely no Excel functionality. If you are somehow
producing Excel spreadsheets, you must be using a gem or plugin.
Without knowing what that is, we can’t help you.

zimbatm … wrote in post #975253:

Hi Ankit,

from what I see, you’re probably using the “spreadsheet” gem in rails,
isn’t it ?

Take a look at the gem’s documentation :
http://spreadsheet.rubyforge.org/ , maybe you’ll find what you need
there.

Cheers,
zimbatm

Hi
Thanks For replying… but the thing is as i told i am NOT USING any
gem/plugin for export of excel.I am using the default feature provided
by rails,and i am controlling the excel with the CSS by defining the
mso(microsoft office) library of styling.My requirement is to change the
worksheet tab name to the desired name…By default what happens is that
the filename and worksheet name is same…

Thanks
Ankit…

2011/1/16 Ankit G. [email protected]:

Thanks For replying… but the thing is as i told i am NOT USING any
gem/plugin for export of excel.I am using the default feature provided
by rails,and i am controlling the excel with the CSS by defining the
mso(microsoft office) library of styling.My requirement is to change the
worksheet tab name to the desired name…By default what happens is that
the filename and worksheet name is same…

Sorry, I didn’t knew you could export xml like that that would be
understood by excel. From what I gathered from the web, did you try to
set ?

On 1/17/2011 4:49 PM, Walton H. wrote:

Without knowing what that is, we can’t help you.

Thanks
Ankit…

If you are using Rails 3, try looking in your Gemfile for ‘roo’ or
‘spreadsheet’. Alternatively, if you post all or part of the ‘report’
view, someone might recognize it.