Get (and set) the print target chosen by the user in PrintOptionsDialog (Printer, Preview, etc)

Hi.

I am modifying my Printloop procedure and, when printing several documents in a row, I want the Print Options Dialog to be shown only for the first document, and the rest to be treated in the same way as the user has defined for the first one.

I know that with LlPrintCopyPrinterConfiguration you can save and restore printer settings when the user chooses a Printer as Print Target in the Print Options Dialog, but what if the user selects Preview instead? In that case I would like all remaining documents to be processed as Preview as well.

Is there a function or variable that I can use to get the Print Target that the user has defined in the Print Options Dialog so that I can set it as the default in the following documents?

Thanks for your help.

P.S: I am working in Delphi with FireDAC-based components.

Hi Carlos,

I think you can call the API LlPrintGetOptionString() with the option value LL_PRNOPTSTR_EXPORT.

In general this is documented also here in this chapter in more detail: Selecting/Querying the Output Format

But if you are using a component - information above are concentrated to use the core API of List & Label with its own printing loop - you have to use an event asking the mentioned option - have a look at this article for doing this: Export Without User Interaction Using OCX / VCL or .NET Component - combit Reporting Forum.

1 Like

Perfect! That’s what I was looking for, I had missed it.

Thank you very much for your help!

1 Like