can pdfCreator create/save pdf by sales invoice no.

teckpoh
Member Posts: 271
Hi Experts,
Can pdfCreator save my report to pdf file by sales inv no?
Example:
When i print "Sales Inv" rpt and filtered by inv no: 1000..3000
and i expect pdfCreator to create and save 3 individual reports which like 1000.pdf, 2000.pdf and 3000.pdf.
Unfortunately at the moment pdfCreator save all records that belong to inv no 1000..3000 into a single pdf file.
How to implement tis??
Below is my coding:
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);
filedir := 'C:\sentbox';
filename := "Sales Invoice Header"."No."+'.pdf';
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.AutosaveDirectory := filedir;
PDFCreatorOption.AutosaveFilename := filename;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
Thank in advace~~
Can pdfCreator save my report to pdf file by sales inv no?
Example:
When i print "Sales Inv" rpt and filtered by inv no: 1000..3000
and i expect pdfCreator to create and save 3 individual reports which like 1000.pdf, 2000.pdf and 3000.pdf.
Unfortunately at the moment pdfCreator save all records that belong to inv no 1000..3000 into a single pdf file.
How to implement tis??
Below is my coding:
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);
filedir := 'C:\sentbox';
filename := "Sales Invoice Header"."No."+'.pdf';
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.AutosaveDirectory := filedir;
PDFCreatorOption.AutosaveFilename := filename;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
Thank in advace~~
0
Answers
-
You need to call the report for each invoice as seaparate report. Filter record over the invoices and call the report in a loop (filter for the specific no. before calling the report) with just changing PDF name.0
-
Dear Kine,
If i call each invoice in a separate report i wonder how i'm gotta to specify the filtering? User might need to enter the filtering "date", "invoice no" in the report itself.0 -
Ah, ok, than you can have one report, which just read the filters, and instead printing will just run the real printing report in a loop for each header in the filter range...0
-
Instead of do it by 2 rpt is it possible to write code and doing some control inside a report with pdfCreator method/property?0
-
No, it is not possible, because printing one report is one print job and you cannot divide it into more files.0
-
Dear Kine,
Thank YOU VERY MUCH~~~ UR APPROACH WORKED WELL~~~~!!!!!!!!0 -
You are welcome.
Please, add prefix [solved] into subject of your first post in this thread...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