Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is the code I generally use:</p> <pre class="lang-vb prettyprint-override"><code>'Generate the Report Dim oRpt As New ReportDocument Dim reportPath As String = Server.MapPath("crtTAL.rpt") oRpt.Load(reportPath) oRpt.SetDataSource(dsTAL) If Not IO.Directory.Exists(tempLocation) Then IO.Directory.CreateDirectory(tempLocation) End If If IO.File.Exists(tempLocation &amp; filename) Then IO.File.Delete(tempLocation &amp; filename) End If ' ******************************** ' First we must create a new instance of the diskfiledestinationoptions class and ' set variable called crExportOptions to the exportoptions class of the reportdocument. Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions Dim crExportOptions As ExportOptions = oRpt.ExportOptions 'Export to Word 'append a filename to the export path and set this file as the filename property for 'the DestinationOptions class crDiskFileDestinationOptions.DiskFileName = tempLocation + filename 'set the required report ExportOptions properties With crExportOptions .DestinationOptions = crDiskFileDestinationOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.WordForWindows End With 'Once the export options have been set for the report, the report can be exported. The Export command 'does not take any arguments Try ' Export the report oRpt.Export() oRpt.Close() oRpt.Dispose() projectCount = projectCount + 1 Catch err As Exception Response.Write("&lt;BR&gt;") Response.Write(err.Message.ToString) errorList = errorList &amp; dtrProjects.Item("Title") &amp; "; " End Try </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload