thanks rashed for that clarifications, but my problem is how to send a pdf report from Navision by mail ; i want to mail the report directly from navision !! ](*,)
Has anyone else come across the error where PDF objects created in ver. 0.9.3 won't run on 0.9.5 and vica versa. Basically the comand below will only run on a coumputer running the same version of PDFCreator that it ws complied with.
The issue is the command
PDFCreatorOption := PDFCreator.cOptions;
Which gives the message:
This message is fo C/AL programmers:
Invalid assignment. It is not possible to assign a _clsPDFCreatorOptions to a clsPDFCreatorOptions.
Its clearly an issue with wich dll you have registered, and I am pretty sure its a PDF creator issue, not a NAV issue.
Its damn anoying having to use a different computer to compile objects to get this to work, and worst is when a client has computers with differnt version of PDF creator installed.
Has anyone solved this?
Use the older build of PDFCreator "PDFCreator-0_9_3_GPLGhostscript.exe"
When I try to run my form (the one showed here and copyed/imported to Navision) I get the error "This message is for C/AL programmers.......
Could not invoke the member cClose, the OLE control or the Automation server returned an unknown error code.
I have tried to uninstall the PDFCreator and then reinstall it. But Navision starts hanging until the service "PDFCreator" is killed.
...Has anyone else come across the error where PDF objects created in ver. 0.9.3 won't run on 0.9.5 and vica versa. Basically the comand below will only run on a coumputer running the same version of PDFCreator that it ws complied with.
...
Use the older build of PDFCreator "PDFCreator-0_9_3_GPLGhostscript.exe"
No I think you missed the error.
Basically if I compile the object in 0.9.3 then the objects will not run on 0.9.5 and if I compile them on 0.9.5 they wont run on 0.9.3
This is not a specific bug in either version, simply that they are incompatible.
I am trying to print the Sales invoice but i cannot name the file as invoice number or even i cannot save it as C:\example.pdf. Its always taking what ever is set on the printer options in PDFcreator autosave settings. I am using vista.
Do i need o change anything?
If I uncheck autosave then it always pops up the save screen to select the location and file name. But i want this to run as a bacth process to print individual invoices with filename as invoice number with manual interaction.
Wierd this is i used your sample code to run the itemlist with c:\example.pdf. But it never takes that location or filename.
If I uncheck autosave then it always pops up the save screen to select the location and file name. But i want this to run as a bacth process to print individual invoices with filename as invoice number with manual interaction.
Wierd this is i used your sample code to run the itemlist with c:\example.pdf. But it never takes that location or filename.
I had some similar issues as this, but it was because I had been playing with the PDF creator settings ](*,) . Eventually I just uninstalled and reinstalled with the default settings and it all worked.
mhm, i'm not use PDF Creator.
I've a Linuxserver with samba and with a little config on smb.conf the samba server also work as PDF PrintServer which can also used from Windows systems. And he sends the pdf back to the user per mail, because he read the userdata from AD (Active directory). This works excellent
But I need to put that in a Form. In Codeunit 82 (Sales-Post + Print)
What I realy want to is:
--> Posting and Print --> create a excel file (this work ok, I create a process only report that create the excel and is call instead of the normal report)
--> Posting and Print PDF --> create a excel file and a pdf file. This create a excel file, a pdf file, but then PDFCreator process don’t close. In this case in then windows task manager the processe of the PDFCreator is running and I have to kill that.
I change de code of the function PrintReport and use the code equal to the code in the test.
Why this do not work?
Has anyone else come across the error where PDF objects created in ver. 0.9.3 won't run on 0.9.5 and vica versa. Basically the comand below will only run on a coumputer running the same version of PDFCreator that it ws complied with.
The issue is the command
PDFCreatorOption := PDFCreator.cOptions;
Which gives the message:
This message is fo C/AL programmers:
Invalid assignment. It is not possible to assign a _clsPDFCreatorOptions to a clsPDFCreatorOptions.
Its clearly an issue with wich dll you have registered, and I am pretty sure its a PDF creator issue, not a NAV issue.
Its damn anoying having to use a different computer to compile objects to get this to work, and worst is when a client has computers with differnt version of PDF creator installed.
I found that the same code did indeeed compile and then work as deisgned after I opened the same database using Nav 4.0 SP3. So I am going to assume that the exe version was the issue and not the version of PDF creator.
I found that the same code did indeeed compile and then work as deisgned after I opened the same database using Nav 4.0 SP3. So I am going to assume that the exe version was the issue and not the version of PDF creator.
ara3n,
Thanks for the example. =D>
You are welcome and happy coding.
Ahmed Rashed Amini
Independent Consultant/Developer
Hello ara3n, When I compiled it, it showed me a error as [You connot enter 'Item List' in ReportNo.Then the cursor jump to OnOpenForm() trigger where have a statement is
ReportID := REPORT::"Item List";
Did I have do anything wrong? :?: or do you have a report call "Item List"? then I need to change to any of mine?
thank you.
Did I made anything wrong, can u tell me where I went wrong
Same problem here. But not randomly :? .
And in NAV the Dialog Processing is open.
The PDFCreator keeps running in the Task Manager.
After ending it, NAV returns an error: could not invoke...
Btw bullzip doesn't have a way to change the the pdf printer to default printer, so you have to set it up in printer selection in NAV. Or make the pdf Printer as default.
Bullzip works on vista and 64 bit compatible.
Ahmed Rashed Amini
Independent Consultant/Developer
This is what I added to make Bullzip default printer.
IF NOT lPrinterSelection.GET('',lReportID) THEN BEGIN
lPrinterSelection.INIT;
lPrinterSelection."Report ID" := lReportID;
lPrinterSelection."Printer Name" := 'Bullzip PDF Printer';
lPrinterSelection.INSERT;
END;
That's a good solution with printerSelection that the user could add to the code.
I would add USERID in there as well. So just in case other people are printing the same report and it doesn't automatically select that printer.
Or maybe delete the record at the end of the process
Ahmed Rashed Amini
Independent Consultant/Developer
I'm all confused, should I create a report, a form or a code unit to place the code that is on the top.
Also should I delete "{}"? since NAV ignore the code that is between {}. What should I do.
Help please, I'm trying to implement automatic report with job scheduler and send them via email.
do you think that using this code may help? I'm using NAV 3.70
Comments
Search Mibuso for smtp
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Use the older build of PDFCreator "PDFCreator-0_9_3_GPLGhostscript.exe"
When I try to run my form (the one showed here and copyed/imported to Navision) I get the error "This message is for C/AL programmers.......
Could not invoke the member cClose, the OLE control or the Automation server returned an unknown error code.
I have tried to uninstall the PDFCreator and then reinstall it. But Navision starts hanging until the service "PDFCreator" is killed.
I'm using the "old" 0_9_3 version.
Any ideas would be nice - thanks.
No I think you missed the error.
Basically if I compile the object in 0.9.3 then the objects will not run on 0.9.5 and if I compile them on 0.9.5 they wont run on 0.9.3
This is not a specific bug in either version, simply that they are incompatible.
I am trying to print the Sales invoice but i cannot name the file as invoice number or even i cannot save it as C:\example.pdf. Its always taking what ever is set on the printer options in PDFcreator autosave settings. I am using vista.
Do i need o change anything?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Wierd this is i used your sample code to run the itemlist with c:\example.pdf. But it never takes that location or filename.
I had some similar issues as this, but it was because I had been playing with the PDF creator settings ](*,) . Eventually I just uninstalled and reinstalled with the default settings and it all worked.
I've a Linuxserver with samba and with a little config on smb.conf the samba server also work as PDF PrintServer which can also used from Windows systems. And he sends the pdf back to the user per mail, because he read the userdata from AD (Active directory). This works excellent
Regards
I did reinstalled the pdfcreator but no luck. still asking me to pick the location and name. its not taking c:\example.pdf filename
I've exactly the same problem. It doesn't assume the filename and directory that i choose in navision.
BR
I need some help.
I have this code in a codeunit:
OnRun()
Teste('171920');
Teste(NrDocumento : Code[20])
gtxtFileDirectory := 'D:\Path1\';
gtxtFileNamePDF2 := 'xx- ' + NrDocumento + '.pdf';
IF EXISTS(gtxtFileDirectory+gtxtFileNamePDF2+'.old') THEN
ERASE(gtxtFileDirectory+gtxtFileNamePDF2+'.old');
IF EXISTS(gtxtFileDirectory+gtxtFileNamePDF2) THEN
IF RENAME(gtxtFileDirectory+gtxtFileNamePDF2,gtxtFileDirectory+gtxtFileNamePDF2+'.old') THEN;
TesteImprimirPDFCreator(gtxtFileDirectory,
gtxtFileNamePDF2,
T112,NrDocumento);
TesteImprimirPDFCreator(gtxtFileDirectory : Text[250];gtxtFileNamePDF2 : Text[250];T112 : Record "Sales In
IF ISCLEAR(gautPDFCreator) THEN
CREATE(gautPDFCreator);
IF ISCLEAR(gautPDFCreatorError) THEN
CREATE(gautPDFCreatorError);
gautPDFCreatorError := gautPDFCreator.cError;
IF gautPDFCreator.cStart('/NoProcessingAtStartup') = FALSE THEN
MESSAGE('Status: Error: ' + gautPDFCreatorError.Description);
gautPDFCreatorOption2 := gautPDFCreator.cOptions;
gautPDFCreatorOption2.UseAutosave := 1;
gautPDFCreatorOption2.UseAutosaveDirectory := 1;
gautPDFCreatorOption2.AutosaveDirectory := gtxtFileDirectory;
gautPDFCreatorOption2.AutosaveFormat := 0;
gautPDFCreatorOption2.AutosaveFilename := gtxtFileNamePDF2;
gautPDFCreator.cOptions := gautPDFCreatorOption2;
gautPDFCreator.cClearCache();
DefaultPrinter := gautPDFCreator.cDefaultPrinter;
gautPDFCreator.cDefaultPrinter := 'PDFCreator';
gautPDFCreator.cPrinterStop := FALSE;
T112.SETRANGE(T112."No.",NrDocumento);
REPORT.RUNMODAL(206, FALSE, TRUE,T112);
// REPORT.RUNMODAL(66012, FALSE, TRUE,T112);
WHILE NOT EXISTS(gtxtFileDirectory + gtxtFileNamePDF2) DO;
gautPDFCreator.cPrinterStop := TRUE;
gautPDFCreator.cDefaultPrinter := DefaultPrinter;
gautPDFCreator.cCloseRunningSession;
gautPDFCreator.cClose;
CLEAR(gautPDFCreator);
CLEAR(gautPDFCreatorError);
CLEAR(gautPDFCreatorOption2);
I run de codeunit and everything is ok.
But I need to put that in a Form. In Codeunit 82 (Sales-Post + Print)
What I realy want to is:
--> Posting and Print --> create a excel file (this work ok, I create a process only report that create the excel and is call instead of the normal report)
--> Posting and Print PDF --> create a excel file and a pdf file. This create a excel file, a pdf file, but then PDFCreator process don’t close. In this case in then windows task manager the processe of the PDFCreator is running and I have to kill that.
I change de code of the function PrintReport and use the code equal to the code in the test.
Why this do not work?
Thanks.
PDFCreator.cOptions := PDFCreatorOption;
I get the following error
A maximum of 0 parameters must be used when calling the function.
Does anyone know what I am doing wrong?
Its the same as this.
Thanks for the reply.
I found that the same code did indeeed compile and then work as deisgned after I opened the same database using Nav 4.0 SP3. So I am going to assume that the exe version was the issue and not the version of PDF creator.
ara3n,
Thanks for the example. =D>
You are welcome and happy coding.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
When I compiled it, it showed me a error as [You connot enter 'Item List' in ReportNo.Then the cursor jump to OnOpenForm() trigger where have a statement is
ReportID := REPORT::"Item List";
Did I have do anything wrong? :?: or do you have a report call "Item List"? then I need to change to any of mine?
thank you.
Did I made anything wrong, can u tell me where I went wrong
Thank you
It is very good. Thanks for u r help.
I have implemented this PDF Creator solution and it is working very well for me apart from one problme.
Randomly, the PDFCreator program will not close when the PDFCreator.cClose(); function is called.
Has anyone experienced this issue???
Thanks,
Jay
Same problem here. But not randomly :? .
And in NAV the Dialog Processing is open.
The PDFCreator keeps running in the Task Manager.
After ending it, NAV returns an error: could not invoke...
Maarten
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Does anyone have experience with this one recently?
http://mibuso.com/blogs/ara3n/
direct link
http://mibuso.com/blogs/ara3n/2008/08/0 ... ts-to-pdf/
You can download BullZip Freeware from
http://www.bullzip.com/download.php
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Bullzip works on vista and 64 bit compatible.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
What a SERVICE!
This is what I added to make Bullzip default printer.
Works great!
Thanx again.
Maarten
I would add USERID in there as well. So just in case other people are printing the same report and it doesn't automatically select that printer.
Or maybe delete the record at the end of the process
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm all confused, should I create a report, a form or a code unit to place the code that is on the top.
Also should I delete "{}"? since NAV ignore the code that is between {}. What should I do.
Help please, I'm trying to implement automatic report with job scheduler and send them via email.
do you think that using this code may help? I'm using NAV 3.70
Thank you for all your support.
OBJECT Form 50101 Example Report to PDF files
{
....
to last braket.
}
Open Notepad and paste it.
Then save the notepad txt file as something. In Navision open object designer and import the txt file you saved, and then compile it.
If you have already a Form 50101 object, then change number in the text file.
You need dev license to import txt files.
Alternatively you can create a new empty report, and create a new function called
PrintToBullZip
and copy evering from
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);
...
until
Window.CLOSE;
Create Global Variables
FileDirectory@1000000000 : Text[100];
FileName@1000000010 : Text[100];
ReportID@1000000001 : Integer;
Object@1000000002 : Record 2000000001;
BullZipPDF@1000000004 : Automation "{61CB5BFA-AFE6-4B0F-A4BB-7F3D4999EE52} 3.2:{BEBDC1DF-D793-4F6C-B8FF-E831A1C2595C}:'Bullzip'.PDFPrinterSettings";
Window@1000000007 : Dialog;
RunOnceFile@1000000005 : Text[1000];
TimeOut@1000000006 : Integer;
Customer@1000000003 : Record 18;
Customer2@1000000011 : Record 18;
and onPrereport call this new function PrintToBullZip.
Make sure Bull Zip printer is your default printer
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n