473,568 Members | 2,964 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Page Orientation of Excel Workbook While Streaming MIME Content

Hi,
I'm trying to customize print settings while streaming HTML content into
Excel. I'm using ASP.NET 1.1 and Excel 2003.
While some printer settings like Margins are working correctly, I cannot
change the Page Orientation to Landscape: mso-page-orientation:lan dscape;.
I tried to produce the Excel Page, save it as HTML, open in text editor and
then copy and paste Excel generated settings. But it did not help.
If anybody resolved this problem before please respond. Your reply is
greatly appreciated.
I'm setting content type as following:
Response.Clear( )

Response.Charse t = ""

Response.Conten tType = "applicatio n/vnd.ms-excel"

Response.AddHea der("Content-Disposition", "attachment ;
filename=Campai gnReports.xls")

And then using <style> and XML tags to change the settings:

<style>

<!--table

{mso-displayed-decimal-separator:"\.";

mso-displayed-thousand-separator:"\,"; }

@page

{margin:1.0in .5in 1.0in .5in;

mso-header-margin:.5in;

mso-footer-margin:.5in;

mso-page-orientation:lan dscape;}

tr

{mso-height-source:auto;}

col

{mso-width-source:auto;}

br

{mso-data-placement:same-cell;}

-->

</style>

<!--[if gte mso 9]><xml>

<x:ExcelWorkboo k>

<x:ExcelWorkshe ets>

<x:ExcelWorkshe et>

<x:Name>Campaig nReports 1 </x:Name>

<x:WorksheetOpt ions>

<x:Print>

<x:ValidPrinter Info/>

<x:Scale>75</x:Scale>

<x:HorizontalRe solution>1200</x:HorizontalRes olution>

<x:VerticalReso lution>1200</x:VerticalResol ution>

</x:Print>

<x:Selected/>

<x:DoNotDisplay Gridlines/>

<x:ProtectConte nts>False</x:ProtectConten ts>

<x:ProtectObjec ts>False</x:ProtectObject s>

<x:ProtectScena rios>False</x:ProtectScenar ios>

</x:WorksheetOpti ons>

</x:ExcelWorkshee t>

</x:ExcelWorkshee ts>

<x:WindowHeight >8700</x:WindowHeight>

<x:WindowWidth> 15195</x:WindowWidth>

<x:WindowTopX>0 </x:WindowTopX>

<x:WindowTopY>1 20</x:WindowTopY>

<x:ProtectStruc ture>False</x:ProtectStruct ure>

<x:ProtectWindo ws>False</x:ProtectWindow s>

</x:ExcelWorkbook >

</xml><![endif]-->

Thanks,

Yelena
Nov 19 '05 #1
2 7253
Just an additional info to a previous message: print settings are working
fine for classic ASP version, but in ASP.NET page only margins are changed.
The Landscape and Scale remain unchanged.
"Yelena Kaplun" <ye**********@h otmail.com> wrote in message
news:eS******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,
I'm trying to customize print settings while streaming HTML content into
Excel. I'm using ASP.NET 1.1 and Excel 2003.
While some printer settings like Margins are working correctly, I cannot
change the Page Orientation to Landscape: mso-page-orientation:lan dscape;.
I tried to produce the Excel Page, save it as HTML, open in text editor and then copy and paste Excel generated settings. But it did not help.
If anybody resolved this problem before please respond. Your reply is
greatly appreciated.
I'm setting content type as following:
Response.Clear( )

Response.Charse t = ""

Response.Conten tType = "applicatio n/vnd.ms-excel"

Response.AddHea der("Content-Disposition", "attachment ;
filename=Campai gnReports.xls")

And then using <style> and XML tags to change the settings:

<style>

<!--table

{mso-displayed-decimal-separator:"\.";

mso-displayed-thousand-separator:"\,"; }

@page

{margin:1.0in .5in 1.0in .5in;

mso-header-margin:.5in;

mso-footer-margin:.5in;

mso-page-orientation:lan dscape;}

tr

{mso-height-source:auto;}

col

{mso-width-source:auto;}

br

{mso-data-placement:same-cell;}

-->

</style>

<!--[if gte mso 9]><xml>

<x:ExcelWorkboo k>

<x:ExcelWorkshe ets>

<x:ExcelWorkshe et>

<x:Name>Campaig nReports 1 </x:Name>

<x:WorksheetOpt ions>

<x:Print>

<x:ValidPrinter Info/>

<x:Scale>75</x:Scale>

<x:HorizontalRe solution>1200</x:HorizontalRes olution>

<x:VerticalReso lution>1200</x:VerticalResol ution>

</x:Print>

<x:Selected/>

<x:DoNotDisplay Gridlines/>

<x:ProtectConte nts>False</x:ProtectConten ts>

<x:ProtectObjec ts>False</x:ProtectObject s>

<x:ProtectScena rios>False</x:ProtectScenar ios>

</x:WorksheetOpti ons>

</x:ExcelWorkshee t>

</x:ExcelWorkshee ts>

<x:WindowHeight >8700</x:WindowHeight>

<x:WindowWidth> 15195</x:WindowWidth>

<x:WindowTopX>0 </x:WindowTopX>

<x:WindowTopY>1 20</x:WindowTopY>

<x:ProtectStruc ture>False</x:ProtectStruct ure>

<x:ProtectWindo ws>False</x:ProtectWindow s>

</x:ExcelWorkbook >

</xml><![endif]-->

Thanks,

Yelena

Nov 19 '05 #2
Jeff Horne
1 New Member
Just an additional info to a previous message: print settings are working fine for classic ASP version, but in ASP.NET page only margins are changed. The Landscape and Scale remain unchanged.
I am encourtering the same issue. Were you able to discover a soultion?

Thanks,

Jeff
Apr 27 '06 #3

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

Similar topics

0
2024
by: Yelena Kaplun | last post by:
Hi, I'm trying to customize print settings while streaming HTML content into Excel. I'm using ASP.NET 1.1 and Excel 2003. While some printer settings like Margins are working correctly, I cannot change the Page Orientation to Landscape: mso-page-orientation:landscape;. I tried to produce the Excel Page, save it as HTML, open in text editor...
1
4345
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy part, but I couldn't initially work out how to manipulate the page setup to change page margins and orientation, that's why I was looking at...
3
2325
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file must be the only method that users receive image files.
3
2794
by: Carlos Magalhaes | last post by:
Hey All, I am doing some excel automation using the excel COM. I can do most of the functions and its working well until I come across a formula. I can run a formula and insert the formula value into a cell. BUT this is where it comes "complex".
5
3328
by: Zadkin | last post by:
Does anyone know, if it's possible to set the orientation of the tabpagebuttons to horizontal instead of vertical when the alignment property of my tabcontrol is set to left or right? Thanks in advance Zadkin
3
1821
by: Don | last post by:
Response.ContentType() = "application/vnd.ms-excel" Response.Charset = "" Response.BinaryWrite(stream) The code when executed causes the client to open an excel document and display the information. Included in the stream is a clock hh:mm:ss that appears in the content.
1
12120
by: himanibhagwat | last post by:
Hi All, In a .NET windows application using C#, I'm opening an existing excel worksheet using office interop, where in I get Excel.Application object, Workbook object etc. I want to set the default orienation to Landscape while this worksheet will be printed by user. I searched around a lot!! But din't find any object with which orientation...
3
5518
by: Maxwell2006 | last post by:
Hi, We have Excel 2003 templates and we need to automatically generate excel 2003 xls files based on our SQL server database tables' data. Since we need to generate the xls files at out asp.net server side, I assume we cannot use excel automation based on the license agreement. What would b the best way to do that? Any help would be...
7
2557
by: Iain Wilson | last post by:
I am pulling my hair out trying to print various objects from a .net web page My apologies for cross posting but I need an answer and my previous post has attracted no interest. ASP.Net 2.0 using C# This is a simple web page on our intranet (written as a test) and all I am trying to do is print a document to a named printer. If I use a...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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 we have to send another system

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.