I have looked through the old postings but did not really get the info I seek. Is it possible to have the content of a specified WORD-file be print on a report? If yes, how? Thanks a lot in advance.
Do I understand correctly that you want to extract the text from a specified Word document and print it on a plain Navision report? If so, I can think of two possibilities: 1) Use Automation code to open the Word doc and save it as a plain text file, e.g. as c:\temp\xxx.txt, then read this text file. We have a (standard) report 1301 which “prints” an ASCII file as a Navision report. This report could be extended to perform the conversion from Word to text just before the actual printing. 2) Use Automation code to directly extract the text as needed. You can use the Range and Selection objects of Word with their .Text property to get pieces of text. Look into Word’s object catalog - there are examples on how to use these objects.
If Heinz did not understand your question… You should copy and past all test into you Navision report. This will not fit into one textbox, so you’ll need to create more textboxes to be able to print all text. User the multiline property of the textbox! Good luck!
Heinz: You “sort of” understood me correctly. I already thought about automation, but… is there a possibility to include the actual WORD layout (I guess the best would be to import a pdf-file!)? Emiel: The problem is that the content of the WORD-document changes and I would like to keep the filename of it and the report itself static, but whenever the report gets printed it includes the current content.
Markus, keeping the layout is going to be a bit tough… [xx(] I’m pretty sure you will be able to retrieve certain font properties (boldness, size etc.) via Automation - but how are you going to set these properties in Navision? You can’t just switch boldness, size, alignment etc. during execution of a report, instead you would have to implement a report section for each and every combination of text attributes. The number of sections will be the product of the number of allowed values for all attributes [B)] You will run into even more problems if you want to keep formatting elements like tables, paragraphs and their indentation and alignment, enumerations and chapters etc. etc. Of course, if you have a big enough budget, I’ll be happy to implement it for you [:D]
I think you want to create a word document from Navision. This means you will hava a Word Template (the word file) and fill this document with data (statistics) from Navision. If you get the data from only one table this can be easaly done trough standard Navision. If you need to access more then one tables to fill this document you have a problem… That is if Weha Automatisering did not exist! We, our NRC, have create a module called C/Office. With this module it’s possible to create a word document containing data from more the one tables in Navision. You can create a complete sales invoice or quote in Word with data from Navision. And that only one feature of this module. You can send us a e-mail for more information: Weha Automatisering B.V. info@weha.nl
Hi Emiel
quote:
Originally posted by eromein
… If you get the data from only one table this can be easaly done trough standard Navision. If you need to access more then one tables to fill this document you have a problem… …
I can’t see any problem here [;)]. Sure you have to call the tables but this shouldn’t be a problem. Or am I wrong? IMHO Markus wants to do the opposite: Take (formated) text from a Word file and print it on a report from within Navision. Here I agree with Heinz. It is almost impossible to check all possible formats [:(]. bye André
Yes, that why he should do it the other way around. Just place you Navision text into the word document. With a bit of luck, you can do this without any customization in Navision 3.60. User the Create Interact functionality (button) on the contact card.
Hi Andre and Emiel, Andre is right, I want to take the formatted text and include it in a report. Since the report is “Sales Invoices”, I would rather not print all my invoices via the Interaction Management. Our sales invoices have a “bank formular” for money transfer on their last (new) page, so we wanted to use the empty space on that piece of paper to include any information (e.g. some lines of advertisement, some current customer info, etc.) that is contained in some external file to be printed. That file could be anything with some kind of format (other than BMP) → pdf, doc, …
Sorry Markus. No idea [:(].
Markus, Thing is, It’s not possible. Plus, how will you invoice of a year ago look? Should it have the lay-out of a year ago or should it look like the invoice defined today? Maybe you should store the extra data in Navision. Maybe using a import which they can run every time they change the format of that text. Or they could just edit the data in Navision. btw, Why is that data stored in external files anyway?
quote:
That file could be anything with some kind of format (other than BMP) → pdf, doc, …
You really think you will be able to read all those file formats from Navision?
quote:
You really think you will be able to read all those file formats from Navision?
Nop, I don’t, but I hoped I could… [:D]