Create a file from a report

How is it possible to create a file from a report ?

Declare MyFile as File; Then use MyFile.TEXTMODE(SetTextMode), MyFile.CREATE(Name) or MyFile.OPEN(Name), MyFile.WRITE(Value), MyFile.CLOSE. You can read more in on-line help

You can save the output from the file as HTML. The user can do this from the Preview screen— or you can write code which uses the r.SAVEASHTML function. Either way, you create a HTML page which looks (almost) exactly like the printed report. Once you have the HTML file, you can edit and manipulate it in all sorts of different programs. Also, you can do file writes from the report triggers to a text file. --Tim Horrigan ------- Tim Horrigan

The reason for using a reprot to generate a file is that I need information from several tables to generate a stock file everyday to send to a SAP system, so I can not use HTML.

OK, what you do in that case is (as I said before) write to a text file from the report triggers. Navision has a small but adequate set of text-maniplating functions. The only thing which doesn’t work too good is when you try to read data from a line which is not supposed to be over 250 characters but is. You COULD possibly use HTML to interface witj SAP, by the way, BUT obviously you would have to clean it up in some other applicatiosn before sending it to Navision. You can also use dataports to create tab-delimited or comma-delimited text files. And of course, you might able to do something with ODCB or OCX, but that’s something I’m not very well informed about :slight_smile: --Tim Horrigan ------- Tim Horrigan

Define a lokal printer type generic/text only. Output destination to file. Print your report!

Hi, But for some reason, if I do that, I get weird characters in the file which I dont want. How can I solve that problem? Roelof.

If you can wait… can anyone wait? theres the new XML stuff coming that will allow you to talk to anything else than can talk XML… including, yes… SAP Craig Bradney Project Manager - Technical Navision Solutions & Services Deloitte Growth Solutions Deloitte Touche Tohmatsu P:+61-2-9322-7796 F:+61-2-9322-7502

I would make a dataport rather than a report. I don’t know SAP but I suppose that SAP is supporting Import of Metastock Format (if you’re talking about stock reports) and Metastock is a simple comma-seperated textfile. Marcus Fabian phone: +41 79 4397872

The easiest way is to have ADOBE Acrobat 4.0. The PDF-writer acts like a printer. PDF-files created this way look like the printed report. Regards Uwe