Export to PDF without user intervention

Hello,
Using LL20 with dBase Plus depends on the LL20.cc.
To setup options to save reports to PDF without user intervention, is it necessary to customise LL20.cc, or can this be done “out of the box”. There are no samples that cover this function.

thanks, Ron

Dear Ron,
thank you for your note.

Following is an example code which is based on our example (LLSample.PRJ)

Changes in the LL20.CC file:
Add to FUNCTION LoadExternLibrary:

EXTERN CLONG      LlXSetParameter(CLONG, CLONG, CSTRING, CSTRING, CSTRING) CMLL20.DLL FROM "LlXSetParameterA"

Modify FUNCTION PrintList
after: nRet=0 nDest = LL_DESTINATION_PRV
add:

LlXSetParameter((this.hJob),LL_LLX_EXTENSIONTYPE_EXPORT, "PDF", 'Export.Path', "c:\temp\"); LlXSetParameter((this.hJob),LL_LLX_EXTENSIONTYPE_EXPORT, "PDF", 'Export.File', "export.pdf"); LlXSetParameter((this.hJob), LL_LLX_EXTENSIONTYPE_EXPORT, "PDF", 'Export.Quiet', '1'); LlXSetParameter((this.hJob),LL_LLX_EXTENSIONTYPE_EXPORT, "PDF", 'Export.ShowResult', '0')

change in LlPrintWithboxStart

LL_PRINT_USERSELECT,; LL_BOXTYPE_NORMALWAIT,;
to

LL_PRINT_Export,;
LL_BOXTYPE_NONE,

After LlPrintWithboxStart
add:

LlPrintSetOptionString((this.hJob),LL_PRNOPTSTR_EXPORT, "PDF");

and uncomment followed lines:

/* IF this.HideCopies LlPrintSetOption((this.hJob), LL_PRNOPT_COPIES, LL_COPIES_HIDE) ENDIF IF this.HidePages LlPrintSetOption((this.hJob), LL_OPTION_PAGE, LL_PAGE_HIDE) ENDIF //D: Default-Ziel setzen //E: Set default target LlPrintSetOption((this.hJob), LL_PRNOPT_PRINTDLG_DEST, nDest) //D: Druckauswahldialog anzeigen //E: Show print options dialog nRet=LlPrintOptionsDialog((this.hJob),; (this.ParentHandle),; IIF(_app.language="DE","Druckereinstellungen","Configure printing parameters")) LlPrintSetOption((this.hJob),LL_OPTION_PAGE,1) */

Thats it, the ExportQuiet Option and LL_BOXTYPE_NONE will make your export without user intervention

Kind regards

Erdal Alacali
technical support
combit GmbH

Thank you Erdal.
Now I get an export.pdf file in c:\temp
If the code below is how I call the report, what do I add to customise the location and name of the resultant pdf file?
r = new LL20InterfaceSample()
r.Design = form.LLDesign
r.Extension = “.LST”
r…Filename = “Reports\InterpreterDailyBookings.lst”
r.render()

Thanks
Ron

Hi,
I urgently need to resolve this. Should I open a support ticket? I am happy to pay to get it resolved.
Thanks.

Hi Ron,

For quick help I’d suggest to open a support case with combit. However, glancing quickly through this thread, you seem quite clos to your solution. I’m not a dBASE guy, but you only need to parametrize the calls to

LlXSetParameter((this.hJob),LL_LLX_EXTENSIONTYPE_EXPORT, “PDF”, ‘Export.Path’, “c:\temp”);

and

LlXSetParameter((this.hJob),LL_LLX_EXTENSIONTYPE_EXPORT, “PDF”, ‘Export.File’, “export.pdf”);

IIUC. I’d just give 2 parameters for the render method and go ahead…

G.

Hello,
Thanks, I have worked it out so if I send the location and file name through as parameters in the render, it works nicely. However, how can I avoid the Print Options dialogue box showing? Can I programmatically select the Direct To as pdf, so there is absolutely no user intervention?
regards
Ron