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

Export Without User Interaction Using Direct API

export
(combit Team) #1
Valid from List & Label 15
In order to perform an export without any user interaction using direct List & Label API (i.e. without using a component like OCX, VCL or .NET) - you need to set the appropriate export options.
Following is a sample for a quiet PDF export with C++.
// Specify the export parameters:
// we want to create a PDF file named 'export.pdf' in the path 'c:\users\public' without dialogs
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PDF"), _T("Export.File"), _T("export.pdf"));
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PDF"), _T("Export.Path"), _T("c:\\users\\public\\"));
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PDF"), _T("Export.Quiet"), _T("1"));

// Start printing without a progress bar
if(::LlPrintStart(m_hLlJob, LL_PROJECT_LIST, sFileName, LL_PRINT_EXPORT, 0) < 0)
return; // Error occurred

// Specify the target export format PDF
::LlPrintSetOptionString(m_hLlJob, LL_PRNOPTSTR_EXPORT, "PDF");

// Now the normal print loop with ::LlPrint(), ::LlPrintFields(), ::LlPrintEnd() etc. comes here 


Note
The export without any user interaction to a preview file (*.ll) is only available in List & Label 16 or newer (before, you had to use LL_OPTIONSTR_PREVIEWFILENAME). Basically, it’s the same code as for the other export formats. Only the export format needs to be set to “PRV”.

// Specify the export parameters:
// we want to create a preview file named 'export.ll' in the path 'c:\users\public' without dialogs
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PRV"), _T("Export.File"), _T("export.ll"));
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PRV"), _T("Export.Path"), _T("c:\\users\\public\\"));
::LlXSetParameter(m_hLlJob, LL_LLX_EXTENSIONTYPE_EXPORT, _T("PRV"), _T("Export.Quiet"), _T("1"));

// Start printing without a progress bar
if(::LlPrintStart(m_hLlJob, LL_PROJECT_LIST, sFileName, LL_PRINT_EXPORT, 0) < 0)
return; // Error occurred

// Specify the target export format preview
::LlPrintSetOptionString(m_hLlJob, LL_PRNOPTSTR_EXPORT, "PRV");

// Now the normal print loop with ::LlPrint(), ::LlPrintFields(), ::LlPrintEnd() etc. comes here 

Verwandte Artikel:

KBTE000612
IDKBTE000780 KBTE000780