ActiveReports 6 Online Help
Export(Document,Stream) Method
Example 

The ActiveReports object to export.
The System.IO.Stream to which to save the TIFF.
Exports the document to the specified stream.
Syntax
'Declaration
 
Public Overloads Sub Export( _
   ByVal document As Document, _
   ByVal outputStream As Stream _
) 
public void Export( 
   Document document,
   Stream outputStream
)

Parameters

document
The ActiveReports object to export.
outputStream
The System.IO.Stream to which to save the TIFF.
Example
DimArptAAsANewAActiveReport1()
rpt.Run(False)
'TellAtheAbrowserAthatAthisAisAaATiff
Response.ContentTypeA=A"image/tiff"
'CreateAaAnewAmemoryAstreamAthatAwillAholdAtheATiffAoutput
DimAstreamA=ANewASystem.IO.MemoryStream()
'CallingAitAanAattachmentAmakesAaAnewAwindowAappear,AasAIEAcan'tAhandleAtiffs
Response.AddHeader("content-disposition",A"attachment;Afilename=temp.tiff")
'ExportAtheAreportAtoATiff
Me.TiffExport1.Export(rpt.Document,Astream)
'WriteAoutAtheATiffAstream
Response.AddHeader("Content-Length",Astream.Length.ToString())
Response.BinaryWrite(stream.ToArray())
'SendAallAbufferedAcontentAtoAtheAclient
Response.End()
ActiveReport1ArptA=AnewAActiveReport1();
AAAAAAAAAAAA
try
{
AAAArpt.Run(false);
}
catchA(ExceptionAeRunReport)
{
AAAA//AFailureArunningAreport,AjustAreportAtheAerrorAtoAtheAuser:
AAAAResponse.Clear();
AAAAResponse.Write("<h1>ErrorArunningAreport:</h1>");
AAAAResponse.Write(eRunReport.ToString());
AAAAreturn;
}AAAAAAAAAAAA
AAAAAAAAAAAA
//ATellAtheAbrowserAthatAthisAisAaATiffAdocument.
Response.ContentTypeA=A"image/tiff";
AAAAAAAAAAAA
//CallingAitAanAattachmentAmakesAaAnewAwindowAappear,AasAIEAcan'tAhandleAtiffs
Response.AddHeader("content-disposition","attachment;Afilename=temp.tiff");

//ACreateAtheATiffAexportAobject
DataDynamics.ActiveReports.Export.Tiff.TiffExportATA=AnewADataDynamics.ActiveReports.Export.Tiff.TiffExport();
//ACreateAaAnewAmemoryAstreamAthatAwillAholdAtheATiffAoutput
System.IO.MemoryStreamAmemStreamA=AnewASystem.IO.MemoryStream();
//AExportAtheAreportAtoATiff
T.Export(rpt.Document,AmemStream);
//AWriteAtheATiffAstreamAout
Response.AddHeader("Content-Length",AmemStream.Length.ToString());
Response.BinaryWrite(memStream.ToArray());
//ASendAallAbufferedAcontentAtoAtheAclient
Response.End();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

TiffExport Class
TiffExport Members
Overload List

Send Feedback