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.Encoding.UTF8);
      xslTran.Transform(xmlDoc,null,writer);

John Holmes
johnsh@co.skagit.wa.us


0
johnsh (1)
3/4/2004 10:53:54 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
735 Views

Similar Articles

[PageSpeed] 27

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

0
v-schang (36)
3/5/2004 5:18:52 AM
John Holmes wrote:

>       xslTran.Transform(xmlDoc,null,writer);

Transform directly to the Response output stream.

-- 
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
0
Oleg
3/5/2004 5:52:20 PM
Reply:

Similar Artilces:

publisher only prints page numbers on even pages
I am using Publisher 2000 and I want to consecutively page number the entire document. When I perform the page numbering procedure page numbers only show on the even pages. The numbers are consecutive, but don't show on the odd pages such as 3 or 5. Do you have a filled textbox on these pages? In Publisher 2000 text boxes are filled white by default, maybe the page number is hid. Are the page numbers within the printable limits of your printer? Is it a booklet setup? In the booklet setup you have to create a page number text box on both the left and the right. -- Mary Sauer MS...

New computer, new outlook
My old machine with Outlook 98 is dying. I have a new machine with XP and new Outlook. How do I transfer the e- mail adresses, settings, calender, old messages, etc. to my new machine? "Geoff" <anonymous@discussions.microsoft.com> wrote in message news:e0b301c3f0cc$a3ebcc80$a101280a@phx.gbl... > My old machine with Outlook 98 is dying. I have a new > machine with XP and new Outlook. How do I transfer the e- > mail adresses, settings, calender, old messages, etc. to > my new machine? just copy your pst file on the old, paste it into your new, remove any Read-on...

Setting Bank's web address
I've tried to change my bank's web site address so that I can go directly to the sign in page instead of having to click through several links from the bank's home page. (If I manually type the address, my browser will go directly to this page.) However, whenever I "connect to my bank" from within the Money menu for an account, it always goes to the bank's home page. What's happening here. How can I change this connection? In microsoft.public.money, David E wrote: >I've tried to change my bank's web site address so that I >can go directly ...

Public folder:'New' menu is not available
Exch2000SP3 I follow instructions below to create new public folders: "Expand Administrative Groups", "expand the group I want to work with". "Expand "Folders"' Right click the root of the folder hierarchy, point to "New", then Public Folder. The problem is that "New" option is simply not available to me. I am ExhAdmin, Enterprise admin. What am I missing here ? Is the 'New' missing, or the New -> 'Public Folder'? If the latter, you need to create a public store and associate it with the public folder tree that...

New install of Great Plains 9.0
We are doing a new implementation of Great Plains 9.0 but we still not have the keys for version 9. Can we install Great Plains 9.0 and create our new companies using the TWO keys available on MSDN and then switch the keys to our keys when they get generated. Are there any issues in doing that. Will there be any issues when I change the Site name and the registration keys later. You should be able to contact sales and service (800-456-0025) and have them issue v9 reg keys. -- Charles Allen, MVP "Jack" wrote: > We are doing a new implementation of Great Plains 9.0 ...

Export everything from Outlook to new computer
Is it possible to export all my data in Outlook 2002 to a new computer that also has Outlook 2002? The most important thing is to get all my current emails and contacts to my new computer. Any help is much appreciated. Regards, Alfie copy the pst file to new pc, ensure read only flag is off, then open in OL. Do not overwrite any existing pst. "alfie" <alfie597@hotmail.comnospam> wrote in message news:cj180e$56n$1@titan.btinternet.com... > Is it possible to export all my data in Outlook 2002 to a new computer that > also has Outlook 2002? The most important thing ...

How to start with new message automatically when opening WLM
Hi all, I use Paperport 12 Pro (a program for filing pdf's, etc) and one of my links at the bottom is Live Mail, it is supposed to work so that when I drop a pdf (or whatever file) on it, will open Live Mail, start a new e-mail and add the file as an attachment. It is not working, all it does is open WLM, and I just wonder if anybody uses it the same way and knows how to make it work. Any help really appreciated Never used it, but have you ensured that WLM(Windows Live Mail) has all of its defaults ? - If it opens WLM, without creating a new message it may not be prog...

Sending a new email
How do I include preset wording in an email? On Apr 23, 4:36=A0pm, John R <John R...@discussions.microsoft.com> wrote: > How do I include preset wording in an email? Which version of Outlook? in 2007, you can use Quick Parts - you have to create your own pieces of text firt of course: while composing a message, select the text you want to use as a Quick PArt, click Insert, Quick Parts, and select the bottom option "Save Selection to Quick Part Gallery." in 2003, you would use Outlook Templates: compose your message (like a form letter), then select File, Sav...

single web page can be viewed without publisher?
I've created a newsletter using publisher 2003, I want to send it to people in single web page (mht) format. Will those without Publisher be able to open and view the newsletter in that format? Why not send it as a .pdf file? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Kaylen" <Kaylen@discussions.microsoft.com> wrote in message news:80A03B40-0CB6-4DB0-A4F9-E68737BBD0B1@microsoft.com... > I've created a newsletter using publisher 2003, I want to send it to > people > in single web pag...

Can get new messages in center of screen?
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop I'm on new imac 27&quot; <br> Boy, open new mail message and it shoots over to the left side of the monitor. Wasn't so bad with 20 CTR. <br> Anyway to get them to be centered? thanks! > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3343028456_1486606 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit On 12/6/09 9:19 PM, in...

Google is the new AntiChrist
Come back Micro$oft. All is forgiven (well, some of it is!). Google is the new AntiChrist :-) Whilst developing a VB6 program (just to keep this on topic!) I installed Google Chrome web browser. I did not like it and so I uninstalled it, and upon doing so I discovered that all web page links (hyperlinks or whatever you call them) in MS Word and MS Publisher and various other applications failed to work, popping up a message to the effect that the operation had been cancelled due to restrictions in effect on this computer and that I should contact my Administrator. So, I took...

XSL Transform Problem using Xml.XSL.Transform
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty well for simple transforms. But as soon as I add Xsl variables or For each loops to the XSL string in the db, it fails to transform the XML. I can see that it will transform everything until that point. ALso If I copy the XSL & XML I am trying to transform from my watch window into a file.. It works perfectly. Any Ideas? The following is the C# code I am using to transform & the XSL I a...

Add data to next new record
I need to add data from my drop downlist. It works, but it's not adding to the next available record. Its adding over the top of data. Can anyone tell me why? DoCmd.GoToRecord , , acNewRec ' Perform some action. Form!sfrmToQCLog![PO] = cboLookupPO.Column(0) Form!sfrmToQCLog![ITEM] = cboLookupPO.Column(1) Form!sfrmToQCLog![VENDOR] = cboLookupPO.Column(2) -- Matt Campbell mattc (at) saunatec [dot] com Message posted via http://www.accessmonster.com ...

New To Customizing Reports
I am new to customizing reports and was wondering if there are any tutorials or any information at all that would get me up and running? Search the newsgroup for things like 'reports' or 'custom reports'. There has been quite a few discussions about how to customize reports already. Also you may want to check out the Reports Library and the Knowledge Base articles if you have access to Customer Source. Rob "leepeach" <leepeach@discussions.microsoft.com> wrote in message news:3E5286ED-8BCC-4951-8E9C-7E0D0B6CB890@microsoft.com... >I am new to customizin...

New to 2003
I posted this in the "calendaring" newsgroup, but it does not appear that anyone really reads that newsgroup. Most of the responses from today are still unanswered. So I am reposting it here. I was just upgraded to Outlook 2003 and I have a question: I have a public calendar (department calendar). I have tried to "Add New Shortcut" and it looks like it works, but the shortcut does not appear. How can I make it easier to go to this commonly used calendar? The only way I can currently get to it is by clicking "Folder List" then clicking on it from there. Tha...

transfer money 2003 program to a new computer
i want to transfer money 2003 to a new computer. can i just use the old cd and put it in the new computer and install it or does microsoft require anything to be done like uninstall etc i would like it on both computers can i do this or do i have to take it off the old one? You can just install from the CD on the new computer. This will **not transfer your data**. Unless one machine is a notebook and the other a desktop and you use them per the license agreement, you are not licensed to have Money installed on both machines at once. Whether or not you let this stop you, I leave to your cons...

New Sharepoint site cannot be found
I have a new install of SBS 2008 premium and I created a new web application in sharepoint. It created fine but when I try to goto the webpage it says, "The webpage cannot be found." How can I fix that. Please advise and thanks. ...

transform data in excel
I need to transform data in an excel srpeadsheet. I need to reverse a 5 rows, 200 columns table into a 5 columns, 200 rows table. Much appreciated!Vincent Hi Vincent Copy the set of data. Got to your destination and choose Paste Special and click the box marked Transpose. -- Regards Roger Govier "Vincent Yang" <vyang69@verizon.net> wrote in message news:MVORb.1866$px6.279@nwrddc02.gnilink.net... > I need to transform data in an excel srpeadsheet. I need to reverse a > 5 rows, 200 columns table into a 5 columns, 200 rows table. > > Much appreciated!Vincent >...

Delete From New Mail Alerts?
Is it possible to delete messages from both the New Mail Alert window and also the Open window (when clicking Open in the New Mail Alert the highlighted single message that will appear) I receive alot of email and it would be far easier if I could delete from this feature rather than having to go back into the Message pane find the messages and delete from there. Thank you I think there's a delete icon in the alert window that you can try using "dogsnack" <dogsnack@discussions.microsoft.com> wrote in message news:A811413E-5845-45D0-808B-EF00EF7808DE@microsoft.com... ...

Hosting .asmx web services on windows ce 5.0
Hello, in windows ce 5.0 there is a web server. is it useful to hosting .asmx web service developed with compact framework ? Thanks, Paolo ...

Can't Create New Entity...Help!!!!!!!!!
Hi; I can't create new entity in crm4 I Opened New entity form and than save clicked after along time get this Error "An Error has occured" .View trace log detail and than see this logs ; >SELECT OrganizationId, EventId, EventData, CreatedOn FROM Notification WHERE CreatedOn > '11/24/2008 12:10:14' [2008-11-24 14:12:15.0] Process: w3wp |Organization: 00000000-0000-0000-0000-000000000000 |Thread: 7(MSCRM:- NotificationManager.NotificationWatcherThreadProc) |Category: Platform.Sql |User: 00000000-0000-0000-0000-000000000000 |Level: Info | NotificationService.Ge...

VBA Code
I suppose I had to face up to it sooner or later... While I know of the existence of VBA code, I have no idea what it is other than that it may be a program to simplify Excel life. Can someone point me in the direction of basics in order that I can start making use of such code, please? An exapmle with a simple of the use of a code would be highly appreciated!! Thanks - you guys are excellent! Take a look at http://www.mvps.org/dmcritchie/excel/getstarted.htm In article <e00901c43c0c$5c2c2e90$a001280a@phx.gbl>, "Manhar" <anonymous@discussions.microsoft.com&...

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: XmlData...

xml transforms to rearrange worksheet data?
xl2010 Anyone here familiar with using xml transforms to massage xl data? I have an inherited spreadsheet I'd like to use a pivot table on, but it is not organized as a list, or table. Seems like I've read that xml transforms can be used to manipulate how data is presented; I'm wondering if I can use a transform to create a new worksheet with the data re-arranged into proper rows and columns. I've no idea even where to start looking for information --- anyone have some links or pointers for me? TIA! -- Clif McIrvin (clare reads his mail with moe, nomail feeds the bit...

XslTransform
Hello everyone. I am trying to generate a document using a XML document and a XSLT stylesheet. There are unicode elements in the XSL style-sheet (Japanese) as seen below: <xsl:template match="delegate"> <xsl:call-template name="type"> <xsl:with-param name="type">�f���Q�[�g</xsl:with-param> </xsl:call-template> </xsl:template> Is there a way of doing the transformation correctly in the presence of the Unicode data?. ie. how do I tell the <XslTransform in...