ActiveReports 14 .NET Edition
GrapeCity.ActiveReports.Export.Pdf Assembly / GrapeCity.ActiveReports.Export.Pdf.Page Namespace / Settings Class / DocumentToAddBeforeReport Property
Example

In This Topic
    DocumentToAddBeforeReport Property
    In This Topic
    Gets or sets the path to the PDF document that should be inserted to the beginning of the rendering output.
    Syntax
    'Declaration
     
    Public Property DocumentToAddBeforeReport As String
    public string DocumentToAddBeforeReport {get; set;}
    Example
    ' Create a new page report
    Dim _reportDef As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") + "\PageReport1.rdlx"))
    Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(_reportDef)
    
    ' Set the information for the PDF file output.  
    Dim exportFile1 As String = Server.MapPath("") + "\PDF\" + System.IO.Path.GetRandomFileName + ".pdf"
    Dim myFile1 As New System.IO.FileInfo(exportFile1)
    Dim settings As New GrapeCity.ActiveReports.Export.Pdf.Page.Settings()
    settings = New GrapeCity.ActiveReports.Export.Pdf.Page.Settings()
    settings.DocumentToAddBeforeReport = exportFile1 'Document to add before report property.
    
    ' Set the rendering extension and render the report.  
    Dim pdfRenderingExtension As New GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension()
    Dim _outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(myFile1.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile1.Name))
    reportDocument.Render(pdfRenderingExtension, _outputProvider, settings)
    // Create a new page report
    GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("") + "\\PageReport1.rdlx"));
    GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);
    
    // Set the information for the PDF file output.  
    string exportFile1 = Server.MapPath("") + "\\PDF\\" + System.IO.Path.GetRandomFileName + ".pdf";
    System.IO.FileInfo myFile1 = new System.IO.FileInfo(exportFile1);
    GrapeCity.ActiveReports.Export.Pdf.Page.Settings settings = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
    settings = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
    settings.DocumentToAddBeforeReport = exportFile1; //Document to add before report property.
    
    // Set the rendering extension and render the report.  
    GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
    GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider _outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(myFile1.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile1.Name));
    reportDocument.Render(pdfRenderingExtension, _outputProvider, settings);
    See Also