Faxing Reports from Dynamics NAV
14th June 2009
I saw some question on mibuso forum on how to fax from Navision. This blog is about how to fax from Navision. This is method uses Microsoft Fax Services. You can use this to fax invoices etc to customers that prefer to receive Invoices by Fax. By default it is not installed and you need to install it. To install Fax Services, you need to open control Panel. Click on Add remove programs and click on Add/Remove Windows Components. Then tick Fax Services and click OK. It may ask for windows CD to install it.
After it is installed, make sure fax service is running in windows services. The code is fairly simple. Here is a screenshot
Notice in code that I am saving it as rtf file instead of html file. The FaxDoc automation issues a print command on the file and the default program that is associated it with suppose to open the file print it and then close. I found on the internet that there are issues with print html files. So by changing the ending of the file to rtf, windows opens MS Word and prints the file. MS word is smart enough to know that it’s a html file and it renders it correctly. If the default program that opens rtf file in your OS is different than word, you might want to try with html file and see if it works or try to save the file as PDF. In 2009 you can save it as excel on service tier so you can try to print excel as well. I tried to change the html file type to open with Microsoft word but no luck.
You can monitor the fax status in fax Console. You can open it from Start->Program files->Accessories->Comunications->Fax->Fax Console. Here is a screenshot.
Before sending fax from NAV you need to click on Tools->Configure Fax and select your modem and check enable Send.
Here is the object for this. FaxExample Happy faxing.
June 15th, 2009 at 12:29 pm
Hi Rashed -
Nifty posting - that’s a great outline of a quick way to automate faxing. The one problem is that especially for sending invoices (that include logos, special formatting, etc.) the HTML format usually doesn’t work the best. I created an add on to automate emailing and faxing of NAV reports as properly formatted documents (PDFs) - for anyone interested, info is available at www.altusbusinesssolutions.com.
Rob
June 15th, 2009 at 12:44 pm
I have already posted a how-to create PDF files for Nav reports. You can use that example with Faxing example and use PDF instead.
June 15th, 2009 at 12:46 pm
You can find the link on how to create pdf files in here.
http://mibuso.com/blogs/ara3n/2008/08/01/save-nav-reports-to-pdf/
June 15th, 2009 at 2:20 pm
Reshid…
Great work… Thenka you so much
I love you Man….
Elie
June 17th, 2009 at 4:20 pm
One question:
How can you send a cover sheet with your fax? I see there is a cover sheet property for FaxDoc but I couldn’t make it to work.
Any ideas?
Thanks
June 17th, 2009 at 7:26 pm
I haven’t tried but it would work the same way FaxDoc.body property would work.
You just need another rtf file.
FaxDoc.CoverPage := ‘C:\CoverPage.rtf’;
June 17th, 2009 at 8:47 pm
I’ve already tried that but it did not work.
Please let me know if you were able to print a coversheet.
Thanks Rashed..
June 18th, 2009 at 1:51 pm
OK I tried it and this is how you get cover pages.
Open the Fax Console and click on tools Personal Cover Pages. Create a new cover page and add what every you want. There are option to add the sender fax and address etc.
Once you are done. Save the file. Change the code to the following and it will work.
REPORT.SAVEASHTML(REPORT::”Top __ Customer List”, FileName ,TRUE);
FaxDoc.Body := FileName;
//Mod1
FaxDoc.CoverPageType := 1;
FaxDoc.CoverPage := ‘C:\COVERPAGE.COV’;
//Mod1
FaxDoc.DocumentName := ‘My Fax’;
June 18th, 2009 at 2:34 pm
It worked.. Thank you..
I knew the part about creating Personal Cover Pages, but I was missing the line of code: FaxDoc.CoverPageType := 1;
I did not know what type to set it to…
Thanks Rashed for all your help..
Elie
June 18th, 2009 at 5:15 pm
You are welcome.
August 10th, 2010 at 3:10 am
please let us know what\’s the type of faxdoc automation of which library ?
August 10th, 2010 at 7:11 am
FaxServer is of type ‘Microsoft Fax Service Extended COM Type Library’.FaxServer
FaxDoc is of type ‘Microsoft Fax Service Extended COM Type Library’.FaxDocument