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

The ActiveReports object to export.
The System.IO.Stream to which to save the TIFF.
A range of page numbers. Ranges are indicated by the use of a hyphen between the starting and ending page numbers in the range. Single pages may also be included. Each range or single page is separated by a comma.
Exports the specified range of pages from the document to the specified stream.
Syntax
'Declaration
 
Public Overloads Sub Export( _
   ByVal document As Document, _
   ByVal outputStream As Stream, _
   ByVal pageRange As String _
) 
public void Export( 
   Document document,
   Stream outputStream,
   string pageRange
)

Parameters

document
The ActiveReports object to export.
outputStream
The System.IO.Stream to which to save the TIFF.
pageRange
A range of page numbers. Ranges are indicated by the use of a hyphen between the starting and ending page numbers in the range. Single pages may also be included. Each range or single page is separated by a comma.
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")
'ExportAtheAfirstAtwoApagesAofAtheAreportAtoATiff
Me.TiffExport1.Export(rpt.Document,Astream,A"1-2")
'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();
//AExportAtheAfirstAtwoApagesAofAtheAreportAtoATiff
T.Export(rpt.Document,AmemStream,A"1-2");
//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