convert report to excel

dear

i want to take few reports in excel.

when we run a report it simple come as it comes. but i want to see the report on excel as well.

How could i do this.

thanking you

There are just so many posts on this subject that I would suggest you search the forum for EXCEL and REPORT.

Check out the posts if you’re still not clear then post a specific question on where you’re stuck.

dear

i want General Ledger Report to be printed in excel.

I am using NAV5.0.

How could i do this.

i already read all post.

Can you suggest me a better solution.

i want to create this option for end users,they do not have access to object desinger. They have only General Ledger Report to access.

thanking you

Hi,

Why not use the standard Account Schedules which have the functionallity built in to export to excel?

It’s not that hard. You create a Global record TempExcelBuffer “Excel Buffer table 370”.

First delete anything in the table in the predataitem() section.

Create a Function called EnterCell. With the following Local variables.

RowNo Integer
ColumnNo Integer
CellValue Text 250
Bold Boolean
Italic Boolean
UnderLine Boolean

EnterCell Function CalCode:

// Excel defaults

TempExcelBuffer.INIT;
TempExcelBuffer.VALIDATE(“Row No.”,RowNo);
TempExcelBuffer.VALIDATE(“Column No.”,ColumnNo);
TempExcelBuffer.“Cell Value as Text” := CellValue;
TempExcelBuffer.Formula := ‘’;
TempExcelBuffer.Bold := Bold;
TempExcelBuffer.Italic := Italic;
TempExcelBuffer.Underline := UnderLine;
TempExcelBuffer.INSERT;

On the report section Body print line this is some sample cal-code on Presection of print line. Only text items can be printed so any dates or numbers need to converted with FORMAT function.

Row:=Row +1;
EnterCell(Row, 1,’’’’+ “Document No.”, FALSE, FALSE, FALSE);
EnterCell(Row, 2,’’’’+ “Buy-from Vendor No.”, FALSE, FALSE, FALSE);
EnterCell(Row, 3,’’’’+ “No.”, FALSE, FALSE, FALSE);
EnterCell(Row, 4,’’’’+ “Order No.”, FALSE, FALSE, FALSE);
EnterCell(Row, 5,’’’’+ Description, FALSE, FALSE, FALSE);
EnterCell(Row, 6,’’’’+ gsStandard3, FALSE, FALSE, FALSE);
EnterCell(Row, 7, Amt2, FALSE, FALSE, FALSE);
EnterCell(Row, 8, Amt3, FALSE, FALSE, FALSE);
EnterCell(Row, 9, Amt4, FALSE, FALSE, FALSE);
EnterCell(Row, 10, PostingDate, FALSE, FALSE, FALSE);

On the postdataitem() section of the report you do the actual writing to the file.

//Create The Worksheet
TempExcelBuffer.CreateBook;
TempExcelBuffer.CreateSheet(Text000,Text000,COMPANYNAME,USERID);
TempExcelBuffer.GiveUserControl;

i want to create general ledger report to excel with the filed

DATE DOCUMENT NO. NARRATION DEBIT CREDIT BALANCE

i know i have to create excelHeader function and excelBody fuction.

when i am creating excel header section some problem is comming.

Please give me code for one header if possible.

other things i will ask later.

On the predataitem() section put it in there for the headings.

Create some text constants under Cal/Globals. i.e. Text01, Text02, etc.

Row := 1;
// Excel column headings
EnterCell(Row, 1, Text01, TRUE, TRUE, TRUE);
EnterCell(Row, 2, Text02, TRUE, TRUE, TRUE);
EnterCell(Row, 3, Text03, TRUE, TRUE, TRUE);
EnterCell(Row, 4, Text04, TRUE, TRUE, TRUE);
EnterCell(Row, 5, Text05, TRUE, TRUE, TRUE);
EnterCell(Row, 6, Text06, TRUE, TRUE, TRUE);
EnterCell(Row, 7, Text07, TRUE, TRUE, TRUE);