combit List & Label 30 - .NET Help
combit.Reporting Namespace / ListLabelPreviewControl Class
Members


ListLabelPreviewControl Class
The preview control displays List & Label preview files. The control also allows export to other formats like PDF or Multi-TIFF.
Object Model
ListLabelPreviewControl ClassListLabelPreviewControl.PreviewPageStyle ClassListLabelPreviewControl.PreviewSelectionFrame ClassListLabelPreviewButtons ClassListLabelPreviewControl.PreviewZoomStyle Class
Syntax
'Declaration
 
Public Class ListLabelPreviewControl 
   Inherits System.Windows.Forms.Control
 
Remarks

Automatic saving of form data

In order to achieve an automatic saving of the contents of any form elements on exit/close, you must ensure that the host calls the PreviewControl's CanClose Method. A very good time for example in WinForms would be the FormClosing event. Otherwise, saving the input form data is not forced.

                                
private void DoPreviewPrint()
{   
    // Create and use List & Label object
    using (ListLabel LL = new ListLabel())
    {
        // Define/Assign data source
        LL.DataSource = CreateDataSet();
       
        // Bind preview control to the List & Label object
        LL.PreviewControl = LLPreviewControl;
       
        // Set print mode to preview control
        LL.AutoDestination = LlPrintMode.PreviewControl;
       
        // Prevent opening the resulting XML file with formular data
        LL.ExportOptions.Clear();
        LL.ExportOptions.Add(LlExportOption.ExportShowResult, "0");
       
        // Register event to define project parameters for autoamtically and silently saving formular data
        LL.DefinePrintOptions += new DefinePrintOptionsHandler(LL_DefinePrintOptions);
       
        // Print
        LL.Print();
    }
}

void LL_DefinePrintOptions(object sender, EventArgs e)
{
    // Get the calling List & Label object
    ListLabel localLL = sender as ListLabel;
   
    // Define project parameters for autoamtically and silently saving formular data
    localLL.ProjectParameters[LlProjectParameter.SaveAsFormat].Value = "XML";
    localLL.ProjectParameters[LlProjectParameter.SaveAsFilename].Value = @"C:\temp\myFormData.xml";
    localLL.ProjectParameters[LlProjectParameter.SaveAsNoSaveQuery].Value = "1";
    localLL.ProjectParameters[LlProjectParameter.SaveAsShowDialog].Value = "0";
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    // Be sure the formular data become saved
    if (LL.Core.IsPrinting || !LLPreviewControl.CanClose())
        e.Cancel = true;
}

 

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            combit.Reporting.ListLabelPreviewControl

Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also