Message-ID: <1026472729.8111.1711632453505.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8110_455061328.1711632453505" ------=_Part_8110_455061328.1711632453505 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html WordTemplate.Save(System.Web.HttpResponse, String, Boolean)</tit= le> <!--[if gte mso 9]> <xml> <o:OfficeDocumentSettings> <o:TargetScreenSize>1024x640</o:TargetScreenSize> <o:PixelsPerInch>72</o:PixelsPerInch> <o:AllowPNG/> </o:OfficeDocumentSettings> <w:WordDocument> <w:View>Print</w:View> <w:Zoom>90</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml> <![endif]--> <style> <!-- @page Section1 { size: 8.5in 11.0in; margin: 1.0in; mso-header-margin: .5in; mso-footer-margin: .5in; mso-paper-source: 0; } td { page-break-inside: avoid; } tr { page-break-after: avoid; } div.Section1 { page: Section1; } /* Confluence print stylesheet. Common to all themes for print medi= a */ /* Full of !important until we improve batching for print CSS */ #main { padding-bottom: 1em !important; /* The default padding of 6em is too mu= ch for printouts */ } body { font-family: Arial, Helvetica, FreeSans, sans-serif; font-size: 10pt; line-height: 1.2; } body, #full-height-container, #main, #page, #content, .has-personal-sidebar= #content { background: #fff !important; color: #000 !important; border: 0 !important; width: 100% !important; height: auto !important; min-height: auto !important; margin: 0 !important; padding: 0 !important; display: block !important; } a, a:link, a:visited, a:focus, a:hover, a:active { color: #000; } #content h1, #content h2, #content h3, #content h4, #content h5, #content h6 { font-family: Arial, Helvetica, FreeSans, sans-serif; page-break-after: avoid; } pre { font-family: Monaco, "Courier New", monospace; } #header, .aui-header-inner, #navigation, #sidebar, .sidebar, #personal-info-sidebar, .ia-fixed-sidebar, .page-actions, .navmenu, .ajs-menu-bar, .noprint, .inline-control-link, .inline-control-link a, a.show-labels-editor, .global-comment-actions, .comment-actions, .quick-comment-container, #addcomment { display: none !important; } .comment .date::before { content: none !important; /* remove middot for print view */ } h1.pagetitle img { height: auto; width: auto; } .print-only { display: block; } #footer { position: relative !important; /* CONF-17506 Place the footer at end of= the content */ margin: 0; padding: 0; background: none; clear: both; } #poweredby { border-top: none; background: none; } #poweredby li.print-only { display: list-item; font-style: italic; } #poweredby li.noprint { display:none; } /* no width controls in print */ .wiki-content .table-wrap, .wiki-content p, .panel .codeContent, .panel .codeContent pre, .image-wrap { overflow: visible !important; } /* TODO - should this work? */ #children-section, #comments-section .comment, #comments-section .comment .comment-body, #comments-section .comment .comment-content, #comments-section .comment p { page-break-inside: avoid; } #page-children a { text-decoration: none; } /** hide twixies the specificity here is a hack because print styles are getting loaded before the base styles. */ #comments-section.pageSection .section-header, #comments-section.pageSection .section-title, #children-section.pageSection .section-header, #children-section.pageSection .section-title, .children-show-hide { padding-left: 0; margin-left: 0; } .children-show-hide.icon { display: none; } /* personal sidebar */ .has-personal-sidebar #content { margin-right: 0px; } .has-personal-sidebar #content .pageSection { margin-right: 0px; } --> </style> </head> <body> <h1>WordTemplate.Save(System.Web.HttpResponse, String, Boolean)</h1> <div class=3D"Section1"> <h2 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)= -Description">Description</h2>=20 <p>If you pass <code>save</code> an HttpServletResponse object, WordWriter = will stream the generated file to the client. This method allows you to spe= cify a default client-side file name, and whether the file should be opened= in the browser window or in Microsoft Word.</p>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>C#</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: csharp; collapse: false; gutter: false= " style=3D"font-size:12px;"> public void Save(System.Web.HttpResponse response, System.String attachmen= tName, boolean openInBrowser) </pre>=20 </div> </div>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>vb.net</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: vbnet; collapse: false; gutter: false"= style=3D"font-size:12px;"> Public Sub Save(ByVal response As System.Web.HttpResponse, ByVal attachment= Name As String, ByVal openInBrowser As Boolean) </pre>=20 </div> </div>=20 <h2 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Paramet= ers">Parameters</h2>=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-respons= e">response</h6> The=20 <a href=3D"http://msdn.microsoft.com/en-us/library/param0(VS.80).aspx" clas= s=3D"external-link" rel=3D"nofollow"><tt>HttpResponse</tt></a> instance of = the page.=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-attachm= entName">attachmentName</h6> Specifies a name for the generated Word file; = this name will be displayed in the download dialog when the file is streame= d to the browser.=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-openInB= rowser">openInBrowser</h6>=20 <p>If <code>openInBrowser</code> is set to <code>true</code>, and the user = chooses to open the file, the file will open in the browser window. If <cod= e>openInBrowser</code> is set to <code>false</code>, and the user chooses t= o open the file, the file will open in Microsoft Word. By default, the file= will open in the browser window. </p>=20 <div class=3D"aui-message warning shadowed information-macro">=20 <span class=3D"aui-icon icon-warning">Icon</span>=20 <div class=3D"message-content">=20 <p>Not all browsers can embed a Word file in the browser window.</p>=20 </div>=20 </div>=20 <h2 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Excepti= ons">Exceptions</h2>=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Argumen= tNullException">ArgumentNullException</h6>=20 <code>Save</code> will throw this exception if=20 <code>null</code> (C#) or=20 <code>Nothing</code> (VB.NET) is passed to the method.=20 <h2 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Remarks= ">Remarks</h2> You can call=20 <a href=3D"/display/WW9/WordTemplate.Save" rel=3D"nofollow">Save</a> more t= han once for a single instance of=20 <a href=3D"/display/WW9/WordTemplate" rel=3D"nofollow">WordTemplate</a>. Th= is allows you to save more than one copy of a generated file, and/or both s= ave the file on the server and stream it to the client.=20 <h2 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Example= s">Examples</h2>=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Streamt= otheclientandopeninMSWord">Stream to the client and open in MS Word</h6>=20 <p>When you pass an HttpResponse object to <code>Save</code>, WordWriter wi= ll stream the generated Word file to the client. The browser will display a= File Download dialog asking the user to open or save the file. The method'= s second parameter specifies a file name to display in the File Download di= alog. If the method's third parameter - <a href=3D"#WordTemplate.Save(Syste= m.Web.HttpResponse,String,Boolean)-param-openInBrowser" rel=3D"nofollow">Op= enInBrowser</a> - is False and the user chooses to open the Word file, the = file will open in Microsoft Word. </p>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>C#</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: csharp; gutter: false" style=3D"font-s= ize:12px;"> oWW.Save(Page.Response, "StringVarOutput.doc", false);</pre>=20 </div> </div>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>vb.net</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: csharp; gutter: false" style=3D"font-s= ize:12px;"> oWW.Save(Page.Response, "StringVarOutput.doc", False)</pre>=20 </div> </div>=20 <h6 id=3D"WordTemplate.Save(System.Web.HttpResponse,String,Boolean)-Streamt= otheclientandopeninthebrowserwindow">Stream to the client and open in the b= rowser window</h6>=20 <p>When you pass an HttpResponse object to <code>Save</code>, WordWriter wi= ll stream the generated Word file to the client. The browser will display a= File Download dialog asking the user to open or save the file. The method'= s second parameter specifies a file name to display in the File Download di= alog. If the method's third parameter - <code>OpenInBrowser</code> - is Tru= e and the user chooses to open the Word file, the file will open in the bro= wser window.</p>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>C#</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: csharp; gutter: false" style=3D"font-s= ize:12px;"> oWW.Save(Page.Response, "StringVarOutput.doc", true); </pre>=20 </div> </div>=20 <div class=3D"code panel pdl" style=3D"border-width: 1px;"> <div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px= ;"> <b>vb.net</b> </div> <div class=3D"codeContent panelContent pdl">=20 <pre class=3D"theme: Default; brush: csharp; gutter: false" style=3D"font-s= ize:12px;"> oWW.Save(Page.Response, "StringVarOutput.doc", True) </pre>=20 </div> </div> </div> </body> </html> ------=_Part_8110_455061328.1711632453505--