I m using NAV 4.0 SP3 SQL.We have 20 users all users machine have Microsoft Business Solution installed.Some users are facing following error while doing export to excel in Analysis By Dimension :
This message is for C/AL programmers:
The call to member CreatePivotTable failed. Microsoft Office Excel returned the following message: The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.
Y some users are getting this error and y some users are not facing this error?Whats the sloution 4 this problem?
Vikram Dabas
Navision Technical Consultant
0
Comments
Do they all have the same version of Excel ETC?
All users have Microsoft Office 2007
Navision Technical Consultant
This message is for C/AL programmers:
Could not invoke the member workbooks.The OLE control or Automation server returned an unknown error code.
Navision Technical Consultant
Has this routine been changed at all ? What about when you use the other analysis reports to export to excel or accounts Schedule.
What happens when you debug the error? The issue should be in Excel buffer i would think
When I m taking another Analysis view code then export to excel functionality is running fine,but my another user got error which was described in earlier post and What do u mean by routine I didnt understand this?When I debug for following error:
This message is for C/AL programmers: The call to member CreatePivotTable failed. Microsoft Office Excel returned the following message: The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.
For this error it stoped in codeunit 424 in function "Export Data"
on line:
xlPivotTable := xlWorkSheet2.PivotTables('PivotTable1');
And, for another error,the dubugger stopped at following line:
xlApp.Workbooks.OpenText(FileName);
in function"Export Data".
Navision Technical Consultant
Is this a new installation or something that has suddenly just appeared? and if so what is it that has changed in the meantime.
It might be worth trying to delete the .zup of an affected user and see if that makes a difference.
Have them do smaller filters first then try again EG shorter time period.
Navision Technical Consultant
Nothing like remote desktop or they have an excel session already open?
Did you try deleting the .zup file of a user?
The Excel problem was related to an issue regarding the version on some of the user’s computer and with a problem in codeunit 424 in Nav 2009 which was using an unknown automation. I changed the version of excel library required and I modified the code in the “troublesome” function – to make it work – luckily this issue was solved for Nav 2009 SP1 and I got most of that functionality. We tested it on several users with different Excel versions and it worked.
Navision Technical Consultant
The error which all users are getting is given below:
This message is for C/AL programmers:
The call to member CreatePivotTable failed. Microsoft Office Excel returned the following message: The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field. :-k
Navision Technical Consultant
Navision Technical Consultant
I am also facing same issue at my user end. Please suggest if you have received any solution for the above problem. I have tried Installations of NAV,Excel.
Thanks,
Ankur
Ankur Tewari
MS Dynamics Technical Consultant
I havnt got any solution from this?I got frustuate!!!!!!!!!!!!!!!!! ](*,)
[-o<
Navision Technical Consultant
Can you do the following to Test.
1- Delete the Zup file of a user and try again.
2- Reinstall navision on the PC.
3 -Reverse the Column lines and try exporting
4 -Include a screenshoot of the Analysis view header, both tabs and body
5 - Check to see if any blank Header values are being created
6 - setup another analysis view similiar to the old one but different, Keep aadding in smaller increaments of changes until you eventually get your error message again that should help you identify what is causing the issue.
Thanks
Ankur
Ankur Tewari
MS Dynamics Technical Consultant
It is because the Header is blank. You may try to create a Pivot with Data in excel with on of the header Blank and the excel gives same error.
Thanks
Ankur
Ankur Tewari
MS Dynamics Technical Consultant
I have only 1 Analysis view code which is getting error and all other Analysis view code are running fine.All users r getting error on 1 Analysis view code only and on this Analysis view code no header is blank.
Analysis view code(which is geating error) is enclosed all other Analysis view code are also same like this,until it is getting error.
Navision Technical Consultant
//Populate excel sheet
xlApp.Workbooks._OpenText(FileName);
xlWorkSheet := xlApp.ActiveSheet;
If your Analysis View dimensions contains local characters (Lithuanian, Latvian, Czech) then sometimes excel opens text file with column headers using incorrect encoding (using default encoding which is wrong). Workaround I have found is to specify encoding you need explicitly
xlApp.Workbooks._OpenText(FileName,1257); //1257 - Baltic Windows
xlWorkSheet := xlApp.ActiveSheet;
I got the same error from a customer this morning.
The Analysis view code was called P&L
I took a gues that excel might not like the Ampersand so I changed the following code in codunit 424 and it sorted my issue.
// xlSheetName := CONVERTSTR(xlSheetName,' -+','___');
xlSheetName := CONVERTSTR(xlSheetName,' -+&','____');
viewtopic.php?f=23&t=38346
Manish