473,492 Members | 4,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code the WorksheetOptions on export to Excel

I have a web page that reads a dataset, populates a datagrid, and then
launches Excel to display the results. I was able to format the results
(font, background color ..) and even create a filter for the top header
row, but I want to also freeze the panes. Does anyone know of a way to
program the WorksheetOptions information?

Below is a sample of what I would like the result to be. I got this
result by freezing the panes in Excel and saving the file to HTML
format. I'm not sure if there is a way to send this information to
Excel.

Any ideas?

<x:WorksheetOptions>
<x:CodeName>Sheet1</x:CodeName>
<x:Selected/>
<x:DoNotDisplayGridlines/>
<x:FreezePanes/>
<x:FrozenNoSplit/>
<x:SplitHorizontal>2</x:SplitHorizontal>
<x:TopRowBottomPane>2</x:TopRowBottomPane>
<x:SplitVertical>2</x:SplitVertical>
<x:LeftColumnRightPane>2</x:LeftColumnRightPane>
<x:ActivePane>0</x:ActivePane>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
</x:Pane>
<x:Pane>
<x:Number>1</x:Number>
</x:Pane>
<x:Pane>
<x:Number>2</x:Number>
</x:Pane>
<x:Pane>
<x:Number>0</x:Number>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
4 3677
This article shows multiple ways to accomplish your goal:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Matt" <mc************@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have a web page that reads a dataset, populates a datagrid, and then
launches Excel to display the results. I was able to format the results
(font, background color ..) and even create a filter for the top header
row, but I want to also freeze the panes. Does anyone know of a way to
program the WorksheetOptions information?

Below is a sample of what I would like the result to be. I got this
result by freezing the panes in Excel and saving the file to HTML
format. I'm not sure if there is a way to send this information to
Excel.

Any ideas?

<x:WorksheetOptions>
<x:CodeName>Sheet1</x:CodeName>
<x:Selected/>
<x:DoNotDisplayGridlines/>
<x:FreezePanes/>
<x:FrozenNoSplit/>
<x:SplitHorizontal>2</x:SplitHorizontal>
<x:TopRowBottomPane>2</x:TopRowBottomPane>
<x:SplitVertical>2</x:SplitVertical>
<x:LeftColumnRightPane>2</x:LeftColumnRightPane>
<x:ActivePane>0</x:ActivePane>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
</x:Pane>
<x:Pane>
<x:Number>1</x:Number>
</x:Pane>
<x:Pane>
<x:Number>2</x:Number>
</x:Pane>
<x:Pane>
<x:Number>0</x:Number>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
Thanks Steve. I saw this article but I didn't think it would solve my
problem because we don't have Excel on our web server. This means that the
entire COM Interop solution suggested would not work. From what I've read in
the article, that's the only one of the solutions that would give me access
to the WorkSheetOptions. I suppose the last option also has the potential to
set the WorkSheetOptions but I don't think having the users change their
security settings in an options. That leaves the middle article solution,
which is what I basically have now. I don't see how I can set freeze panes
option using my current solution.

I should have mentioned that I'm looking for a solution that is server side
and doesn't use COM Interop. My bad.

Any other suggestions?

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uK**************@TK2MSFTNGP11.phx.gbl...
This article shows multiple ways to accomplish your goal:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

Nov 18 '05 #3
You might consider one of these 3rd party products to make the whole process
easier:
http://www.aspose.com/Products/Aspose.Excel/
http://officewriter.softartisans.com/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Matt" <mc************@hotmail.com> wrote in message
news:Zv*********************@newssvr11.news.prodig y.com...
Thanks Steve. I saw this article but I didn't think it would solve my
problem because we don't have Excel on our web server. This means that the
entire COM Interop solution suggested would not work. From what I've read in the article, that's the only one of the solutions that would give me access to the WorkSheetOptions. I suppose the last option also has the potential to set the WorkSheetOptions but I don't think having the users change their
security settings in an options. That leaves the middle article solution,
which is what I basically have now. I don't see how I can set freeze panes
option using my current solution.

I should have mentioned that I'm looking for a solution that is server side and doesn't use COM Interop. My bad.

Any other suggestions?

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uK**************@TK2MSFTNGP11.phx.gbl...
This article shows multiple ways to accomplish your goal:

http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


Nov 18 '05 #4
Thanks for the suggestion. We don't plan on doing this a lot so buing a 3rd
party product isn't an option right now.

I guess this can't be done. I was hoping that I could somehow send the code
in via the reponse object using a writer but I guess not. I know this can be
done using XML (but that's a different animal) but I have found this to be
too slow.
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:et**************@tk2msftngp13.phx.gbl...
You might consider one of these 3rd party products to make the whole process easier:
http://www.aspose.com/Products/Aspose.Excel/
http://officewriter.softartisans.com/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Matt" <mc************@hotmail.com> wrote in message
news:Zv*********************@newssvr11.news.prodig y.com...

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3655
by: Gaffar | last post by:
Hello, how to export ms-access tables information to excel sheet using ASP. please give sample code. it is very urgent to me or if u have no idea please give any news group to solve my...
4
14735
by: Paolo | last post by:
Friends, I need help with some code to export different tables to a single spreadsheet in Excel. My excel file is named REPORT and the spreadsheet is named CLIENTS. I do have the code to export...
0
1446
by: Max Mayer | last post by:
Hello everybody, I have implemented a windows form in C# .NET to export data from a listbox to Excel. I work on a Windows XP machine with Office 97 and .NET framework 1.1 SDK installed. I use...
0
1521
by: Max Mayer | last post by:
Hello everybody, I have implemented a windows form in C# .NET to export data from a listbox to Excel. I work on a Windows XP machine with Office 97 and .NET framework 1.1 SDK installed. I use...
0
1158
by: Mortar | last post by:
i am dynamically creating controls when i do a server side export to an excel file. I can only get it to work if I have no <% %> anywhere in my html. i.e. i am writing out session name to the...
3
2001
by: Marja Ribbers-de Vroed | last post by:
Hi, One of my clients has a strange problem with my webapplication which I think may be related to some firewall setting on his computer. On several screens in the application, it is possible...
4
8691
by: paul.chae | last post by:
I have a table in Access with about 3000 records. There are ~60 unique values in the ID field for the 3000 records. What I would like to do is automatically generate multiple Excel worksheets...
4
14992
by: Jiro Hidaka | last post by:
Hello, I would like to know of a fast way to export data source data into an Excel sheet. I found a way from C# Corner(Query Tool to Excel using C# and .NET) which is a neat little way of...
4
14360
NeoPa
by: NeoPa | last post by:
Introduction: Macro Security Levels in MS Office applications are recommended to be set to High. This stops any VBA code associated with a project from running, unless it is signed (with a...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.