473,416 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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:landscape;.
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.Charset = ""

Response.ContentType = "application/vnd.ms-excel"

Response.AddHeader("Content-Disposition", "attachment;
filename=CampaignReports.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:landscape;}

tr

{mso-height-source:auto;}

col

{mso-width-source:auto;}

br

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

-->

</style>

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

<x:ExcelWorkbook>

<x:ExcelWorksheets>

<x:ExcelWorksheet>

<x:Name>CampaignReports 1 </x:Name>

<x:WorksheetOptions>

<x:Print>

<x:ValidPrinterInfo/>

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

<x:HorizontalResolution>1200</x:HorizontalResolution>

<x:VerticalResolution>1200</x:VerticalResolution>

</x:Print>

<x:Selected/>

<x:DoNotDisplayGridlines/>

<x:ProtectContents>False</x:ProtectContents>

<x:ProtectObjects>False</x:ProtectObjects>

<x:ProtectScenarios>False</x:ProtectScenarios>

</x:WorksheetOptions>

</x:ExcelWorksheet>

</x:ExcelWorksheets>

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

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

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

<x:WindowTopY>120</x:WindowTopY>

<x:ProtectStructure>False</x:ProtectStructure>

<x:ProtectWindows>False</x:ProtectWindows>

</x:ExcelWorkbook>

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

Thanks,

Yelena
Jul 22 '05 #1
0 2016

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

Similar topics

2
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...
1
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...
3
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...
3
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...
5
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...
3
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...
1
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...
3
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...
7
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...
1
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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
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...

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.