How to show a preview in WPF ListLabelViewerControl

If you want to use the ListLabelViewerControl, you need to create a preview file first and then assign the path to its FileName property. You can do so by following the advice in Export Without User Interaction Using OCX / VCL or .NET Component and use LlExportTarget.Preview in your ExportConfiguration.

Something along the lines of

ExportConfiguration cfg = new ExportConfiguration(LlExportTarget.Preview, @"c:\temp\export.ll", "export.lst");
LL.Export(cfg);
llViewer.FileName = @"c:\temp\export.ll";

should do the trick.

If you’d like to print directly to a WPF preview window and use incremental preview and interactive features like drill-down etc, you need to use the EnhancedViewerControl WPF class. See the DataBindingSample for WPF for an example. Basically, this class offers a PreviewControl property that can be assigned to the ListLabel object in your code above like so:

ll.PreviewControl = enhancedPreviewControl.PreviewControl;

Does that help?