Export Same Table data in one excel with different sheet in Nav 2009.

ManiNav
Member Posts: 120
Hi Everyone,
I am trying to export the same table data using process only report in one excel with multiple sheet in NAV 2009. ie, any particular table's 10 fields and corresponding data in first sheet and another 10 fields and corresponding data in second sheet of same excel.
I tried for one sheet its working fine, but i need as above query in multiple sheets in one excel.
please suggest me for..
Thanks,
Mani.
I am trying to export the same table data using process only report in one excel with multiple sheet in NAV 2009. ie, any particular table's 10 fields and corresponding data in first sheet and another 10 fields and corresponding data in second sheet of same excel.
I tried for one sheet its working fine, but i need as above query in multiple sheets in one excel.
please suggest me for..
Thanks,
Mani.
0
Answers
-
Hi Everyone,
In Process only report:
1. I have added two data item as G/L entry1 and G/L entry2 for same table G/L entry; as i need two sheet in one excel.
2. I have created two function: one for header:-MakeExcelHeader, and one for body:-MakeExcelBody
Screenshot:
I am using the below code to export data:
please check once,where i am doing wrong.
Documentation()
G/L Entry1 - OnPreDataItem()
G/L Entry1 - OnAfterGetRecord()
IF NOT HeaderPrinted THEN
MakeExcelHeader(1);
MakeExcelBody(1);
HeaderPrinted := FALSE;
G/L Entry1 - OnPostDataItem()
ExcelBuffer.CreateBook();
ExcelBuffer.CreateSheet('Daily Sales','Report', COMPANYNAME, USERID);
G/L Entry2 - OnPreDataItem()
ExcelBuffer.DELETEALL;
HeaderPrinted := FALSE;
G/L Entry2 - OnAfterGetRecord()
IF NOT HeaderPrinted THEN
MakeExcelHeader(2);
MakeExcelBody(2);
HeaderPrinted := TRUE;
G/L Entry2 - OnPostDataItem()
ExcelBuffer.CreateBook();
ExcelBuffer.CreateSheet('Import','Report', COMPANYNAME, USERID);
ExcelBuffer.GiveUserControl();
ERROR('');
MakeExcelHeader(HeaderFor : Integer)
ExcelBuffer.NewRow;
CASE HeaderFor OF
1:
BEGIN
ExcelBuffer.AddColumn('G/L Account No.(GL Code)',FALSE, '', TRUE,FALSE,FALSE,'');
ExcelBuffer.AddColumn('Global Dimension 2 Code(Analysis Code)',FALSE, '', TRUE,FALSE,FALSE,'');
END;
2:
BEGIN
ExcelBuffer.AddColumn('Global Dimension 1 Code(Dept Code)',FALSE, '', TRUE,FALSE,FALSE,'');
ExcelBuffer.AddColumn('Posting Date' ,FALSE, '', TRUE,FALSE,FALSE,'');
END;
END;
MakeExcelBody(BodyFor : Integer)
ExcelBuffer.NewRow;
CASE BodyFor OF
1:
BEGIN
ExcelBuffer.AddColumn("G/L Entry1"."G/L Account No.",FALSE, '', TRUE,FALSE,FALSE,'');
ExcelBuffer.AddColumn("G/L Entry1"."Global Dimension 2 Code",FALSE, '', TRUE,FALSE,FALSE,'');
END;
2:
BEGIN
ExcelBuffer.AddColumn("G/L Entry2"."Global Dimension 1 Code",FALSE, '', TRUE,FALSE,FALSE,'');
ExcelBuffer.AddColumn("G/L Entry2"."Posting Date" ,FALSE, '', TRUE,FALSE,FALSE,'');
END;
END;
Documentation()
Report - OnInitReport()
Report - OnPreReport()
Report - OnPostReport()
//ExcelBuffer.OpenBook();
ExcelBuffer.DELETEALL;
Report - OnCreateHyperlink(VAR URL : Text[1024])
Report - OnHyperlink(URL : Text[1024])
Please check once my code i guide me, where i am doing wrong.
Even there is no compilation error, but excel is not generating. when i run the report its buffering continuously.
Thanks,
Mani.
0 -
Hi Everyone,
Please guide me for the above query.
Thanks,
Mani.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions