Setting the Excel workbook name through my Ruby Code.

A

Ankit Gupta

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.
 
A

Ankit Gupta

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..
 
W

Walton Hoops

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.
 
W

Walton Hoops

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.
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.
 
J

Jonas Pfenniger (zimbatm)

2011/1/16 Ankit Gupta said:
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 <Worksheet ss:Name="My Tab Name"> ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top