BullZipPDF - Generating and Emailing

kaybee
Member Posts: 49
Hi, I understand there are loads of threads on this. But is there a way of printing to the BullZip PDF printer without the need of having to set the BullZipPDF as the default printer or having it in the printer selection table? As obviously I need to not only be able to email it but also for the users to manually print it to a hard printer.
The following is my function:
I also have a problem in the above, users often modify the sales line, so the order report should effectively be updated when they click to create the PDF again, however they are always emailed the cached version of the PDF document from the previous call. So in the above, I simply append date and timestamps to the filename, so that it keeps generating a unique file for attachment.
Realistically, it should delete the file, but it keeps saying "Error deleting, file in use".
The following is my function:
Dlg.OPEN('Preparing Document...'); IF ISCLEAR(BullZipPDF) THEN CREATE(BullZipPDF); FileDirectory := ENVIRON('TEMP') + '\' {Text001}; FileName := xFileName; IF EXISTS(FileDirectory+FileName) THEN IF NOT ERASE(FileDirectory+FileName) THEN FileName := FORMAT(TODAY, 0, '<day><month><year>') + FORMAT(TIME, 0, '<Hours24><Minutes,2><Seconds>') + xFileName; BullZipPDF.Init; BullZipPDF.LoadSettings; RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE); BullZipPDF.SetValue('Output',FileDirectory+FileName); BullZipPDF.SetValue('Showsettings', 'never'); BullZipPDF.SetValue('ShowPDF', 'no'); BullZipPDF.SetValue('ShowProgress', 'no'); BullZipPDF.SetValue('ShowProgressFinished', 'no'); BullZipPDF.SetValue('SuppressErrors', 'yes'); BullZipPDF.SetValue('ConfirmOverwrite', 'no'); BullZipPDF.WriteSettings(TRUE); TimeOut := 0; WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN SLEEP(100); //was 1000. TimeOut := TimeOut + 1; END; Dlg.CLOSE; EXIT(FileDirectory+FileName);
I also have a problem in the above, users often modify the sales line, so the order report should effectively be updated when they click to create the PDF again, however they are always emailed the cached version of the PDF document from the previous call. So in the above, I simply append date and timestamps to the filename, so that it keeps generating a unique file for attachment.
Realistically, it should delete the file, but it keeps saying "Error deleting, file in use".
0
Comments
-
kaybee wrote:But is there a way of printing to the BullZip PDF printer without the need of having to set the BullZipPDF as the default printer or having it in the printer selection table?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
You need to check that the generatin process finished and the file is available for other processes. It was already solved on the forum. Principle is simple: try to open the file for writing. If Succeeded, finished. If not, still generating the file...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions