How to save Navision Reports as PDF
Comments
-
The problem now is when i do this:
REPORT.RUN(ReportSelection."Report ID",False,True,SalesInvHeader);
then the Request Form is activate.
If i do this:
REPORT.RUN(ReportSelection."Report ID",True,True,SalesInvHeader);
Then the Request Form isn't activate but the default printer is changed to PdfCreator and then there isn't a print.
In in the PdfCreator i don't see the print.0 -
Checked with RunModal?0
-
I'm using PdfCreator and i do this:
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreatorOption.AutosaveFilename := FileName;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(ReportID,FALSE,TRUE);
But my problem is that my Default printer is changed to PdfCreator printer, do you know to change again in code to my old default printer.0 -
After PDFCreator finishes you set it back this way.
PDFCreator.cDefaultPrinter := DefaultPrinter;0 -
Thanks, it's going ok.0
-
Just OK? not great?0
-
It's going great.0
-
Sorry, but i've a new problem with PdfCreator
I'm doing this: I want to generate as pdf's as invoices and send them by e-mail
.
.
REPEAT
SetPdf;
Report.RUN(206,FALSE,TRUE,SalesInvoiceHeader);
IF (NOT EXISTS(MyFile)) AND (CONT < 5) THEN BEGIN
SLEEP(3000);
CONT := CONT + 1;
END;
IF EXISTS(MyFile) THEN
SendMail;
ClearMyPdf;
UNTIL SalesInvoiceHeader.NEXT = 0;
In SetPdf i set up the pdf
In SendMail, i Attachment the file and send it.
In ClearMyPdf, i clear pdf
But the problem is sometimes some pdf hasn't been created, i think that the problem is that i don't put PdfCreator.cClose, but i can't to put it because doesn't run. Do you know something about it?0 -
Change. Report.run to
Report.runmodal0 -
I did it, but nothing.
I'm going to do a new form, with the errors, and in this form i'll try to generate the falure invoices to a pdf.0 -
Hi Everybody,
First of all well done ara3n for your coding. Just one question pls. How can I attach another pdf to the background? There should be a field for sure but I still can't find a list of fields available anywhere.
Best Regards,
Steve0 -
Hi,
I have managed to create the background but I would like to get the pdf from a picture in navision, do you think this is possible?
Best Regards,
sabzam0 -
well you could print the picture to PDF and then attach the PDF as background as you mentioned in your previous post.0
-
Hi!
I have a problem, and I need help. I want to save my pdf file directly to NAV 5.1 database table after create it. It is possible?
I create a BLOP type in a table.
Thx!0 -
yes it's possible.0
-
Thx for the answer!
But how? I've tried to search pdfcreator option like .AutosaveDirectory, but I find nothing.
Gegii0 -
Look at my example.
Once the pdf file is created, you need to save the file into blob file.
MyBlob.save('C:\mypdffile.pdf\,false);0 -
Thx for the answer!
It's works!
Only one question: the pdf file exists in the file system. It is possible, that the file is not generated in the file system? i want to only my NAV database.
regards, Gegii0 -
No it's not possible. You have to have the pdf file as intermediate. You can delete it after you load it into blob.0
-
Someone willing to share their codeunit for printing and emailing of the created PDF file?0
-
Hello,
when I try to save a pdf I now get the PDFCreator options screen while I would like this to go silent. Is there something wrong in my code?
onderaannemerslijstREC.SETFILTER("Job No.","Job No.");
onderaannemerslijstREC.SETFILTER(Aktie, 'Calculator');
datum := FORMAT(TODAY);
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
Temppath := ENVIRON('TEMP');
filename := "Job No." + ' ' + 'Calculator' + ' ' + datum +'.pdf';
PDFCreatorOption.AutosaveDirectory := Temppath;
PDFCreatorOption.AutosaveFormat := 0; PDFCreatorOption.AutosaveFilename := filename;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
REPORT.RUN(78726,FALSE,FALSE,onderaannemerslijstREC);
PDFCreator.cDefaultPrinter := DefaultPrinter;
PDFCreator.cClose;
CLEAR(PDFCreatorOption);
CLEAR(PDFCreator);
CLEAR(PDFCreatorError);0 -
Hi,
the new PDFCreator 0.98 gives me some headaches too.
I just noticed that the new PDFCreator ignores the Options set. PDFCreator didn't do anything and when I switched to the PDFCreator window it asked me some options and then created the PDF without error. The problem was that I set these options by code.
You now need to use the PDFCreator.cSaveOptions(); so that the options you set are really used!!!PDFCreator.cOptions := PDFCreatorOption; PDFCreator.cSaveOptions(); PDFCreator.cClearCache();
Regards,
KarstenKarsten Frank
MCP - Dynamics NAV Developer0 -
Before installing PDFCreator, please read this http://www.mibuso.com/forum/viewtopic.php?f=16&t=35052David Singleton0
-
It's sad that the developer took this approach.0
-
Does PDFCreator allow you to add an overlay? I am experimenting with novaPDF, which is not free, but I had very quick positive results with their software. It also allows me to create pdf's programatically within NAV using a COM object. And based on the report I run, I can choose different overlays to add as a background to the document.0
-
I haven't looked at that feature, but bullzip allows you to set other pdfdocuments as background/overlay
http://mibuso.com/blogs/ara3n/2008/08/0 -
how do you add the "defaultprinter" trick with bullzip?0
-
you can try and use report selection in NAV. set the report to print to specific printer.0
-
you can try and use report selection in NAV. set the report to print to specific printer.
Ok, but what if you want to use the same report (like sales confirmation) to print and send as pdf?
Then, you'll have to manually change the printer when you print the report...
Create a duplicate of the report just to print as pdf?0 -
No, before running your code insert a record into report selection.
Then afterwords delete the record.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