473,398 Members | 2,389 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,398 software developers and data experts.

How to XslTransform.Transform to new web page from code behind?

I'm working with a typed dataset and want to implement a print button that
prints my formatted data without the company logo and other stuff on the
form. I've created an XSLT file to transform the XML version of the dataset
into HTML and would like to display it in a new browser window leaving the
original window up and/or maybe even just send it out to the default printer
or bring up the print dialog for printing out the web page. I have
successfully saved the html file, but I'm not sure how to send to a new
browser window instead of a file. Please help, code below:

XmlDataDocument xmlDoc = new XmlDataDocument(dsAffidavit);
XslTransform xslTran = new XslTransform();
xslTran.Load(Server.MapPath("Affidavit.xslt"));
XmlTextWriter writer = new
XmlTextWriter(@"C:\tmp\Printout.htm,System.Text.En coding.UTF8);
xslTran.Transform(xmlDoc,null,writer);

John Holmes
jo****@co.skagit.wa.us
Nov 12 '05 #1
2 1218
Hi John,

I'm viewing the post and found that this is a cross one with another in the
asp.net queue. I've replied you and provided my suggestions in that thread.
Please check it out and do you think it convenient that we continue to
discuss in that thread? If so, please feel free to post there if you have
any further questions. Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 12 '05 #2
John Holmes wrote:
xslTran.Transform(xmlDoc,null,writer);


Transform directly to the Response output stream.

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #3

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

Similar topics

2
by: Graham Pengelly | last post by:
Hi I am trying to transform on System.Xml.XmlDocument into another using XslTransform without writing the object out to a file. I am guessing it should work something like this... public...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
1
by: Franck | last post by:
Hi, Getting crazy with the XslTransform Class. I'm trying to transform an xml string with an xsl string with the following code : 'Create the XslTransform object and load the stylesheet. Dim...
3
by: John Holmes | last post by:
I'm working with a typed dataset and want to implement a print button that prints my formatted data without the company logo and other stuff on the form. I've created an XSLT file to transform the...
4
by: Sean Hoffman | last post by:
Framework 1.1 SP1. Page.xml is about 1.5mg. m_oXSLTransform.Transform takes about 2 minutes. When Page.xml is trimmed down to a smaller doc, it takes about 2 seconds. Same code ran in about...
1
by: Franck | last post by:
Hi, Getting crazy with the XslTransform Class. I'm trying to transform an xml string with an xsl string with the following code : 'Create the XslTransform object and load the stylesheet. Dim...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
1
by: rmgalante | last post by:
Hello, I have a VB.Net component that uses the XslTransform object. I am using the FXSL randomizeList function in my XSL template. When I transform the XML in the VB.Net component, my...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a > b)...
9
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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
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,...
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...

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.