Gets the options controlling the behavior of export modules.
Namespace:
C1.Win.C1PreviewAssembly: C1.Win.C1Report.2 (in C1.Win.C1Report.2.dll)
Syntax
C# |
---|
[BrowsableAttribute(true)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)] public ExportOptions ExportOptions { get; } |
Visual Basic |
---|
<BrowsableAttribute(True)> _ <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property ExportOptions As ExportOptions Get |
Examples
The following example uses the ExportOptions property to export the document to a PDF, HTML, RTF, or XLS form:
Copy CodeVisual Basic
Private Function GenerateSampleDocument() As C1.C1Preview.C1PrintDocument Dim doc As C1.C1Preview.C1PrintDocument = New C1.C1Preview.C1PrintDocument doc.StartDoc doc.RenderBlockText("This is a sample document.") doc.EndDoc Return doc End Function Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) C1PrintPreviewControl1.Document = GenerateSampleDocument End Sub Private Sub SetCustomForms() ' PDF form. C1PrintPreviewControl1.ExportOptions("PdfExportProvider").OptionsDialogClassName = "CustomExportForms.CustomPdfForm" ' HTML form. C1PrintPreviewControl1.ExportOptions("HTMLExportProvider").OptionsDialogClassName = "CustomExportForms.CustomHtmlForm" ' RTF form. C1PrintPreviewControl1.ExportOptions("RtfExportProvider").OptionsDialogClassName = "CustomExportForms.CustomRtfForm" ' XLS form. C1PrintPreviewControl1.ExportOptions("XlsExportProvider").OptionsDialogClassName = "CustomExportForms.CustomXlsForm" End Sub Private Sub RestoreDefaultForms() C1PrintPreviewControl1.ExportOptions.Reset End Sub Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) SetCustomForms End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) RestoreDefaultForms End Sub |
Copy CodeC#
private C1.C1Preview.C1PrintDocument GenerateSampleDocument() { C1.C1Preview.C1PrintDocument doc = new C1.C1Preview.C1PrintDocument(); doc.StartDoc(); doc.RenderBlockText("This is a sample document."); doc.EndDoc(); return doc; } private void Form1_Load(object sender, System.EventArgs e) { c1PrintPreviewControl1.Document = GenerateSampleDocument(); } private void SetCustomForms() { // PDF form. c1PrintPreviewControl1.ExportOptions["PdfExportProvider"].OptionsDialogClassName = "CustomExportForms.CustomPdfForm"; // HTML form. c1PrintPreviewControl1.ExportOptions["HTMLExportProvider"].OptionsDialogClassName = "CustomExportForms.CustomHtmlForm"; // RTF form. c1PrintPreviewControl1.ExportOptions["RtfExportProvider"].OptionsDialogClassName = "CustomExportForms.CustomRtfForm"; // XLS form. c1PrintPreviewControl1.ExportOptions["XlsExportProvider"].OptionsDialogClassName = "CustomExportForms.CustomXlsForm"; } private void RestoreDefaultForms() { c1PrintPreviewControl1.ExportOptions.Reset(); } private void button1_Click(object sender, System.EventArgs e) { SetCustomForms(); } private void button2_Click(object sender, System.EventArgs e) { RestoreDefaultForms(); } |