Data's To an Excel File From a Report

Dear All I want to write all the info’s appearing on a Report on to an Excel File. How can i do this . How can i open an excel sheet from navision. Regard’s Prem

Hi Kumar ! You may create a variable with DataType - Automation and Subtype ‘Microsoft Excel 10.0 Object Library’.Application; And one more variable with DataType - Automation and Subtype ‘Microsoft Excel 10.0 Object Library’.DataTable; After that, look at all included methods for these variables, you may find what you need. Regards, DMC

… or you could use the function SAVEASHTML; you can open *.html with Excel (Versions?). To open an existing Excel-Sheet from Navision you also could use the SHELL-function, e.g. SHELL(’\Excel.exe’, <path\name of Excel-File>’); Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP

Dear Chadaev Thank U very Much for the help. I have done this, but i dont know how to create a new file and write info’s onto that , when i checked for the help its asking for a file VBAXL9.CHM if u have it can u please send it to me. and also for your information i am using ‘Microsoft Excel 9.0 Object Library’ , its advisable if u can send me an example… my email address is Thanking U Regard’s Prem

Hi Prem ! You made me sweat, while looking for the answer ! :wink: Look for the code in attached file. Notes: 1.You may create a temoprary file manually or like I’ve made it (in my code); 2. I have Excel 10 installed on my PC - but you may find the same Automations for Excel 9.0. (‘Microsoft Excel 9.0 Object Library’) 3. There are couple of useless Globals there, look at the code and you’ll define which one d’u need. Since it was impossible to upload my file (they have some problems on the server) - look for the code in the next postings; Best regards, DMC

{ You may create a temporary file this way: TextFile.CREATETEMPFILE; FileName := TextFile.NAME + ‘.txt’; TextFile.CLOSE; } IF ISCLEAR(xlApp) THEN CREATE(xlApp); IF ISCLEAR(xlWorkSheet) THEN CREATE(xlWorkSheet); xlApp.Workbooks.OpenText(‘d:\1.txt’); xlWorkSheet := xlApp.ActiveSheet; xlSheetName := ‘My Example Sheet’; xlSheetName := CONVERTSTR(xlSheetName,’ ‘,’’); xlWorkSheet.Name := xlSheetName; xlApp.ActiveWorkbook.Sheets.Add(); xlWorkSheet3 := xlApp.ActiveSheet; xlWorkSheet3.Name := ‘DMC Example’; xlWorkSheet3.Range(‘A1’).Value := TABLECAPTION; xlWorkSheet3.Range(‘B2’).Value := ‘Here is my TEXT’; YourNo := ‘6’; xlWorkSheet3.Range(‘B’ + YourNo).Value := ‘One more entry’; xlApp.Visible := TRUE;

VARIABLES: VAR xlApp@1023 : Automation “{00020813-0000-0000-C000-000000000046} 1.3:{00024500-0000-0000-C000-000000000046}:Unknown Automation Server.Application”; xlWorkBook@1022 : Automation “{00020813-0000-0000-C000-000000000046} 1.3:{00020819-0000-0000-C000-000000000046}:Unknown Automation Server.Workbook”; xlWorkSheet@1021 : Automation “{00020813-0000-0000-C000-000000000046} 1.3:{00020820-0000-0000-C000-000000000046}:Unknown Automation Server.Worksheet”; xlWorkSheet2@1020 : Automation “{00020813-0000-0000-C000-000000000046} 1.3:{00020820-0000-0000-C000-000000000046}:Unknown Automation Server.Worksheet”; xlWorkSheet3@1014 : Automation “{00020813-0000-0000-C000-000000000046} 1.3:{00020820-0000-0000-C000-000000000046}:Unknown Automation Server.Worksheet”;

Hi, There is no easy way to get the report data out to Excel. You have to put manually each text box into a cell. But something that I used a lot to make is easier and more consistent is use the “Excel Buffer” table and its code … That table is used by Attain to export/import Budgets and export Account Schedules. But you can just get the codeunit and import it in NF 2.60 (i even did it for NF 2.00). Read the code and you’ll see all you need. Regards, Cristi

Dear Nicola Can u Please send me the fob to Regard’s Prem

Its actually the table that you need to import, not a codeunit.

Remeber that when you try to import the table, it won’t work, so delete all the fields except field 1, and all the variables and functions.

Then import this table.

Then export the complete object as text, and import this into 2.60.

You can import directely fobs from 3.01 or 3.10 to navision Financials 2.60. Best regards from BCN

Dear Cristian! Could you please send to forum sample with using procedures of “Excel Buffer” table. Its very progressive way to excel output. 2 Kumar The different way… see tips&tricks on this forum.

decision have find! its great 1. fill table 370 2 run this: ############################ BUF.CreateBook(); BUF.CreateSheet (‘NAME’,‘DESCR’,COMPANYNAME,USERID); BUF.GiveUserControl; ################################# where BUF=table 370;