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
876 Views

Similar Articles

[PageSpeed] 6

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:

Printing problem
Something in Excel has popped up; something new which is driving me NUTS! I had a document which I was printing to a file and then making into a PDF. It was about 17 pages and was printing FINE. OK, then I needed to make a couple more pages for notes. So I copied a couple sheets like I normally did to create new sheets and made my notes pages. NOW, however, when I go to print the dang thing, it prints IN SEVERAL FILES. It used to print in ONE file so I could make my PDF file out of it. But now, NOOOOOO. When printing it keeps prompting me for new filenames. This is driving me NUTS!!!! ...

How do I add new symbols/pix to my bullet list?
Hello everyone! I am new to OneNote & I LOVE it... I am gradually learning all the features as I continue to use it for school + personal stuff. I cannot figure out how to add new bullets (symbols/pix/etc.) to my bullet list in onenote ~ it is driving me crazy! I want to have a completely new bullet on my bullet library list. Is there any way I can get one off of microsoft word or somewhere to permanently add to my bullet library on OneNote??? Please help! Or let me know if im even making sense.. I don't think it can be done. Only the default ones are available. Of cou...

Have a display "Paging" through an XML file.
Via an ASPX (and code behind) in .net 2.0 I want to be able to "page" though and display the contents of an xml file. So if there are 100 elements, I can display "page 1 of 4" and list 25 elements per page. How can I do this? Below is the code used to display the XML file // Create XmlDocument and load the XML from file string FilterValue = "Autos"; XmlDocument XmlDoc = new XmlDocument(); XmlDoc.Load(new XmlTextReader(XMLFILE)); //Create the XsltArgumentList to be passed to the xslt doc XsltArgumentList xslArg = new XsltArgumentList(...

Code pour suppression module
Bonsoir tout le monde. Pour des besoins de maintenance d'une petite appli qui tourne sous Excel j'aimerais pouvoir par code supprimer un module et le remplacer par un autre. Es ce possible???? Par avance merci pour votre aide. http://www.cpearson.com/excel/vbe.htm -- Kind regards, Niek Otten "tip.tiptop" <tip.tiptop@free.fr> wrote in message news:4419d838$0$20837$636a55ce@news.free.fr... > Bonsoir tout le monde. > Pour des besoins de maintenance d'une petite appli qui tourne sous Excel j'aimerais pouvoir par code supprimer un module et le >...

Altered Ship Country Code Not transfering
Ok, long drawn out case I have been working with Microsoft to no success. When we alter the ship to address details, the country code and country do not move along with the order to backorder/reorder or to invoice. Microsoft has "confirmed" yep, it happens on your system. But they are blaming it on modified forms. I have only modified certain fields to make them "required" so data entry folks put in details we require for our business processes. Microsoft can not, will not, determine what is wrong with the forms file itself or which requirement is causing the ...

do no split table across pages
How do I make a table NOT split across pages without adding a page break? The last row goes on the next page. I might add text above so adding a page break is not a good solution. Can we clarify - you DONT want a table to extend to a new page. The following article has tips on how to control tables extending across pages. http://word.mvps.org/FAQs/TblsFldsFms/KeepTableOn1Page.htm Hope this helps DeanH "jammer" wrote: > How do I make a table NOT split across pages without adding a page > break? > The last row goes on the next page. > I might add t...

Background picture behind chart
In Excel I have successfully inserted a picture behind an interactive chart so the chart (graph) is visible overtop of the picture. But when I Save as Web Page the picture doesn't show up. The graph is fine, and is interactive, but the background picture file (gif) has disappeared. How can I preserve the picture so it will save as part of the Web Page? Thanks. Ralph Hi, Not tested but could you use the picture as the Fill Special for the chart or plot area? Cheers Andy RalphB wrote: > In Excel I have successfully inserted a picture behind an interactive chart > so the...

Web Link
I would like to create a link in Excel to a website that has currency exchange rate. I would then like to select specific rates to insert in the spreadsheet so that whenever the spreadsheet is opened, the exchange rates will be current per the website. Can anybody assist. Thanks Please reply to me if you figure out how to do this! I am running int the same problem -- Message posted from http://www.ExcelForum.com ...

Error submitting to web service (for developers)
I get the following error when submitting the referurl for our webleads to the C# web service I created. Everything else works fine. The custom field is of type string 255. A sample referurl that causes the error would be: http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=sterling+ledet This is submitted within the XML as: <CFSReferURL>http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF -8&q=sterling+ledet</CFSReferURL> The Error message I get is: ErrorMessage: SOAP Server Application Faulted <detail><error>&...

how do i up load from my pictures to advertising web site
how do i up load from my pictures to an advertising web site On Wed, 25 Nov 2009 15:58:01 -0800, pictures <pictures@discussions.microsoft.com> wrote: >how do i up load from my pictures to an advertising web site Ask the administrator of the website. The technique will differ from site to site. In any case, this question does not appear to have anything to do with Visual Basic for Applications modules in Microsoft Access, which is the subject of this forum. -- John W. Vinson [MVP] ...

New POP3 E-Mail Account Deliver Folder
I have both an Exchange Account and a (personal) POP3 account that I check using Outlook 2003. Currently, both accounts drop new e-mail into my Exchange Inbox - and I have a rule that moves the POP3 e-mail to a personal folder inbox. Problem is, rules don't run when I'm not connected to the Exchange server. Is it possible to have the POP3 account post new e-mails to the personal folder, while keeping the Exchange account posting new e-mails to the exchange inbox? Thanks; Michael Have you tried to set up a personal folder specifically for the pop account and set the exchange acc...

What will the new MSN Bill Pay charge for paying bills online?
As those of you know use Microsoft Money know, MSN Bill Pay has undergone some changes recently. If I remember correctly Microsoft partners with a company called CheckFree to handle the MSN Bill Pay. (I could be wrong about that.) Anyway, what I want to know is, how much is the new company going to charge for paying bills online through MSN Bill Pay? Rod, It's still CheckFree (no "new company"). Any charges for the service are currently the same as before. Regards, JB Rod wrote: > As those of you know use Microsoft Money know, MSN Bill Pay has undergone > som...

New Document Page
Somehow I saved text on my "NEW" document page. When I open a new page, it has text on it. Tried clearing and saving but it wants to save a new document, not the blank page. Anyone know how to get back to a new blank document page? Thanks, CT See http://word.mvps.org/FAQs/AppErrors/BlankDocNotBlank.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "CT" <CT@discussions.microsoft.com> wrote in message news:D640D22B-FC36-43B8-9D46-CC07AF564CA9@microsoft.com... > Somehow I saved text on...

Workbook page numbering
How do you get consecutive page numbers in a workbook with multiple worksheets? Group select them, then print: Click on the leftmost sheet and shift-click on the rightmost. In article <085101c3779f$ad811850$3101280a@phx.gbl>, "Terri" <tsavage@worleyassociates.com> wrote: > How do you get consecutive page numbers in a workbook with > multiple worksheets? Forgot to mention: Make sure you ungroup the sheets once your printing is done - any changes in a grouped sheet is made to all of the group. In article <jemcgimpsey-2D8D31.08470810092003@msnews.microso...

Page Options in Publisher 2007
I woner if anyone has a clue about this problem I am having. None of the 5 Microsoft technicians that I have talked to have any understanding. I create a newsletter by starting with a newsletter template. I modify the template by adding my own stories and artwork. That works fine. But then, when I want to made a web doxument of this, I want to convert the mulicolumn newsletter to a single column web newsletter. To do this, I go to PAGE OPTIONS and click "1 Column." But when I do this, all of my work is erased and replaced by the content of the original template as it wa...

Restoring Money file to a new PC
I am trying to open a Money file on a newly configured Dell PC (new hard drive and a fresh copy of XP standard.) I reinstalled my copy of MS Money 2001 and tried to open the most recent money file (*.mny from my back up) and it is asking for a password before it will open?? Only problem is that I have never used a password on MS Money....ever! What am I doing wrong or is there a way around this? Any suggestions helpful...Thanks KK In microsoft.public.money, KKRoadie wrote: >I am trying to open a Money file on a newly configured Dell PC (new hard >drive and a fresh copy of XP s...

Pdf/Multiple Pages/& Publisher
Hi, I created a catalog merge in Publisher. The merge creates 100 different postcards and they are printing 4 different postcards to a page. My problem is the printers cannot access a publisher file, so I'm trying to convert it to a pdf. I have a pdf writer so that's not a big deal, I use it all the time. For some reason though this time when I print to pdf, it's creating 12 different pdf documents instead of one. The printer is charging us $4.00 to open every file and I don't want to pay more to open my files then it will cost me to have them printed. Any ideas on...

Licence code
I want to install CRM 1.2 but it asks me for a Licence code. When I look in the readme file on the cd-rom it sends me to www.greatplains.com. This site is not active and I have only the cd-key Can you give me information about how to aquire a licence key? Hi Albert, You might want to check out the Microsoft Business Solutions website: http://www.microsoft.com/BusinessSolutions/howtobuy_overview.aspx Regards Rob Bakkers, Avanade Netherlands "Albert van Boerum" wrote: > I want to install CRM 1.2 but it asks me for a Licence code. When I look in > the readme file on the ...

Search Code Problem
I have a search that I would like to have run from three tables. 'strSQL = "SELECT tblHouses.RollNumber, tblHouses.PID, tblHouses.FirstOfHouseAddress, tblAccounts.AccountNo, tblListNos.MainListNo1, tblListNos.MStatus, tblListNos.ProjectID, tblHouses.Strata, tblHouses.Inactive, tblHouses.FirstOfPostalCode, tblHouses.FirstOfHouseNumber, tblHouses.FirstOfRoadName, tblHouses.LotNo, tblHouses.Telephone1, tblHouses.Telephone2, tblListNos.MPriority, tblListNos.MaintenanceComments, tblListNos.MainIssuedDate " _ '& "FROM (tblHouses LEFT JOIN tblListNos ON tblHouses.R...

"Not in list" event code
Hello everyone: I'm having problems with the below code for adding combo box input if input is not' in the list. What are the variables here that I must change the names of, etc...? I've tried a couple things but was not successful. Thank you! ********Code Start****************** Option Compare Database Private Sub Combo54_NotInList(NewData As String, Response As Integer) Dim db As DAO.Database Dim rs As DAO.Recordset Dim strMsg As String strMsg = "'" & NewData & "' is not an available Document Number Name " & vbCrLf & vbC...

Finding the new Record
I need my new records, once entered, to slot into their alphabetical position in the form, not at the END of the form/table. If I enter a record and then "Me.Requery", the record pointer goes to the first record, not the record I just entered. I've been struggling with me.recrodsetclone.bookmark, but results are inconsistent - it works if I click my save button, but NOT if I click on the pencil icon on the top right of the form. TABLE with 3 fields RecNo (autonumber) fname (text) sname (text) ENTRY FORM form sorted in order of Surname RecNo (visible but not enabled) Fi...

what should be my pop3 and SMTP when setting up new account
what should be my pop3 and SMTP when setting up new account Ask your ISP. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Rogan asked: | what should be my pop3 and SMTP when setting up new account On Sat, 24 Sep 2005 21:44:09 -0700, "Rogan" <Rogan@discussions.microsoft.com> wrote: >what should be my pop3 and SMTP when setting up new account We have no way of knowing what that info is for your account....

The Code One
http://www.thecodeone.com/vb/index.htm ...

Creating a new form everytime a contact is made
I have created a database in Access 2003 to keep track of all of the data needed for our hospital based bariatric program. The forms created work well. However now my problem arises that originally there was one contact about a month after surgery and the information filled in. Now the staff would like to show multiple contacts for that same patient using the same questions but on differant days or months. What I am trying to avoid is creating a giant form with the same fields listed six times because they might contact the patient once a month for six months or possibly daily ...

duplicate items with different item look up codes ---
I have several items that are the same, but since I get them from different suppliers, they have different item look up codes. For example, I have 4 different vendors for cherry tomatoes. The problem is when reporting it can show as no item xxxxx tomatoes were sold where in fact I sold $200.00 worth of cherry tomatoes under a different look up code. Is there a way to link the multiple item look up codes? Thank you. Could you used aliases? Just use one lookup code, say "CT", then use each of your old lookuup codes as aliases for "CT", then put all four cherry toma...