+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

C#/WPF LL.Print() is blocking


(Oskar Atkinson) #1

I need to preview multiple reports, need them visible side by side.

However

LL.Print() is a blocking call.
So, I try
Task.Run( () =>
{
LL.AutoDestination = rs.AutoDestination;
LL.AutoShowPrintOptions = rs.AutoShowPrintOptions;
LL.AutoShowSelectFile = rs.AutoShowSelectFile;
LL.DefinePrintOptions += LL_DefinePrintOptions;
LL.Print();
LL.Dispose();
LL = null;

                });

which works in general, but the looks of the preview changes dramtically compared to a direct LL.Print()

Am I missing something ?
Thanks
Oskar


(Oskar Atkinson) #2

well, it can be done :slight_smile:

prepwork:
in the startup of the app
public static ListLabel LLpub;

LLpub = new ListLabel();
LLpub.LicensingInfo = “secret”; // :slight_smile:

closing the app, cleanup
if (null != LLpub)
LLpub.Dispose();

then to print/preview

ListLabel LL = new ListLabel();
LL.DataSource = ds;

        LL.DataMember = "ReportMaster";
        LL.AutoProjectFile = lstfile;
        LL.AutoProjectType = rs.ProjectType;
            Thread tr = new Thread(
                () =>
                {

                    LL.AutoDestination = LlPrintMode.Export;
                    LL.AutoShowPrintOptions = false;
                    LL.AutoShowSelectFile = false;
                    LL.DefinePrintOptions += LL_DefinePrintOptions;
                    LL.Print();
                    LL.Dispose();
                    LL = null;
                }
                );
            tr.SetApartmentState(ApartmentState.STA);
            tr.Start();