Excel Buffer Error

Normajm
Member Posts: 82
Hello,
I'm trying to create a report that will export to Excel (my first try at this). A very simple report with just six columns. I've copied code from a report that already was set up to export and modified it. The end result is an error:
The Excel Buffer already exists.
Identification fields and values:
Row No.='1',Column No.='1'
When running the debugger, it shows and "insert" in table 370 as the problem.
There are 5 functions copied:
MakeExcelInfo
MakeExcelDataHeader
MakeExcelCustHeader
MakeExcelDataBody
CreateExcelbook
The code in all but MakeExcelDataBody and createExcelBook have been remmed out.
This is the MakeExcelDataBody code (for testing, I want only the first column)
This is the CreateExcelBook code:
There are five sections to the report:
Header1
Body2
GroupFooter1
Footer2
Footer3
The data I want to export is in groupfooter1 where I have added this code to the presection:
I also added code to OnPostReport
Any suggestions on where I went wrong with this?
Thank you.
JNM
I'm trying to create a report that will export to Excel (my first try at this). A very simple report with just six columns. I've copied code from a report that already was set up to export and modified it. The end result is an error:
The Excel Buffer already exists.
Identification fields and values:
Row No.='1',Column No.='1'
When running the debugger, it shows and "insert" in table 370 as the problem.
There are 5 functions copied:
MakeExcelInfo
MakeExcelDataHeader
MakeExcelCustHeader
MakeExcelDataBody
CreateExcelbook
The code in all but MakeExcelDataBody and createExcelBook have been remmed out.
This is the MakeExcelDataBody code (for testing, I want only the first column)
ExcelBuf.NewRow; ExcelBuf.AddColumn(Item."No.",FALSE,'',TRUE,FALSE,FALSE,'');
This is the CreateExcelBook code:
ExcelBuf.CreateBook; ExcelBuf.CreateSheet('Customer','Unit Sales Report',COMPANYNAME,USERID); ExcelBuf.GiveUserControl; ERROR('');
There are five sections to the report:
Header1
Body2
GroupFooter1
Footer2
Footer3
The data I want to export is in groupfooter1 where I have added this code to the presection:
IF (PrinttoExcel)THEN MakeExcelDataBody();
I also added code to OnPostReport
IF PrinttoExcel THEN CreateExcelbook;
Any suggestions on where I went wrong with this?
Thank you.
JNM
0
Comments
-
Check whether ExcelBuf in your report is set to temporary. Check in T370 whether a real record exists and delete it.Frank Dickschat
FD Consulting0 -
Hi,
I Have also got the same error many times; If the error is exist then i will go the Excel buffer table then i will delete all the records.
Is this the only way to achieve error free? ](*,)Regards,
srinivas
"Delighting Customers.... Through Delivery Excellence" .0 -
srinivas.chittem wrote:I Have also got the same error many times; If the error is exist then i will go the Excel buffer table then i will delete all the records.
Is this the only way to achieve error free? ](*,)
Use NDT to find all occurences of T370 in reports. It will also list whether the records are temporary or not. Makes it rather easy to find the inorrect ones.Frank Dickschat
FD Consulting0 -
I checked table 370 and it had three rows of data in it which I deleted. I ran the report and instead of outputting to excel, it ouputted to the screen with a blank report. Checked table 370 and it had those same three rows of data in it again.
Where is ExcelBuf set to temporary?0 -
Found where to set ExcelBuf to temp;0
-
but still not exporting to Excel0
-
Woo hoo!! Outputting to Excel. For some reason, the OnPost Report code hadn't saved.
Thanks for the help!0 -
Well, too soon to celebrate. I'm getting headers but no data. Is there supposed to be code for "MakeExcelDataBody" somehwere?0
-
review this post - lots of examples as you scroll down.
http://dynamicsuser.net/forums/p/25998/140880.aspx
.
.
.
.
.
http://savatage99.googlepages.com/Excel ... ummies.doc
http://www.mibuso.com/dl.asp?FileID=596&Type=file
http://savatage99.googlepages.com/50095 ... oExcel.fob
http://savatage99.googlepages.com/Repor ... ToExce.txt
http://savatage99.googlepages.com/50085 ... oExcel.fob
http://savatage99.googlepages.com/Repor ... elExpo.txt
http://savatage99.googlepages.com/Repor ... el_2.0.fob0 -
Got it now, everything is as it should be...0
-
Thank you for the links, Savatge. Will read them over..0
-
thanx.
i have completed the task.
The error was removed by setting the excelbuf variable's property(Excelbuff) to temporary-Yes0
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