Epplus generated charts missing in Numbers - excel

I've found out a compatibility issue, trying to save .xlsx file with Epplus.Core library.
If I open generated file in Excel 2016, everything is perfect, but if I use macOs or iOs Numbers application, then all the charts dissapear.
I get an error:
"Charts of unsupported type or size were either imported as an image or removed".
Also want to notice, that during tests sometimes charts appeared in file, but axis had wrong scale (values were about 4kk, but axis max limit was just 4).
It's very important for me to create file, that could be read correctly in both Excel and Numbers applications.
I've thought about exporting worksheet to .pdf, but I have several worksheets, and it would be problem to export two files (one .xlsx with data and another one .pdf with charts) in one moment.
Is there any other solution for this issue?

Finally the problem was in naming of worksheet with chart's datatable.
It should be no spaces in worksheet name, then Apple Numbers successfully display all the charts.
Also chart with type = eChartType.BarClustered can become a problem.
I don't know why, but Apple Numbers throw an error, if there is chart with this type on worksheet.

Related

Save SPSS data to existing worksheet (replace) in Excel creates new worksheet

I have an Excel file that auto-computes some summary statistics for data from a tab and my objective is to export SPSS data exactly to that tab.
I am using an older version of SPSS and I found this syntax on another post that sort of addressed my need
SAVE TRANSLATE /TYPE=ODBC
/CONNECT='DSN=Excel Files;DBQ=<Path>;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;'
/ENCRYPTED
/MISSING=IGNORE
/REPLACE
/TABLE='Data'
/KEEP=<VARS>.
The complication is that up until last week, this was working like a chart, but now all of a sudden this same syntax, when used with the same files I tested before, always creates a new tab called "Data1" instead of replacing the existing tab "Data"
Would anyone have a clue why this might be happening and how to fix it?

Microsoft Excel keeps repairing my .xlsm file for no apparent reason and eliminates data validations on a sheet

I recently created an automated Excel utility (using Microsoft Office 2019), in which I've extensively used data validations, VBA code, named ranges and formatting. It was working well until one day I received an Excel prompt message that read:
When I click on Yes, it gives me another pop-up where it says it recovered the file, and also gives me a link to the error log XML file. I click on it and open the .xml file using my default browser, and it shows the following details:
Looks like it is removing data validations from a particular sheet, and I realize that is true when I navigate to that sheet in the UI. To work around this unwarranted and repeated data-validation removal that Excel application is enforcing, I created a macro code that will re-instate all these data validations as required. The real problem arises when this Excel file is opened on a different computer with Microsoft Office 365. Looks like it is removing not just data-validations but also other components like named ranges and buttons. There could be other things that it might be removing, which I am unaware of at the moment. So the macro created to re-instate the data-validations is no longer useful.
Why does this problem arise? And why is different version of Excel behaving differently? How do I solve this? Appreciate your kind help. Thank you!
As rightly suggested by Ron Rosenfeld and e_conomics, the issue was with the data validation lists, whose sources were strings of comma separated values that were going beyond 255 characters. Apparently, that is a limitation with Excel.
When I replaced the sources of data validation lists (string of comma separated values) with the ranges containing the corresponding values, the problem resolved itself. The repair dialogue never appeared again.

Docx4J Generated XLSX file is always corrupt

TL;DR: Excel Workbook generated by Docx4J always says corrupted but I can't determine what Excel doesn't like about the underlying XML, let alone how to fix it.
My use case is as follows:
I am trying to produce an excel workbook with charts and graphs automatically on a regular basis. Only the raw data will change but everything else will dynamically update as the raw data is changed.
So I built an excel workbook which has a number of charts and graphs being generated by a sheet of raw data. I am using it as a template. All values of the raw data are numeric. The intent was to use Docx4J to read this 'template' and to populate the raw data sheet, then save it as a new file whereupon opening will initiate the recalculation and the charts and graphs will update. Since I am new to Docx4j, I basically decided to do baby steps by first seeing if I could open and read the contents of the cells; which I could. So far so good. I also could change the values of the cells but I could only verify this programatically by writing out to the console the location and value before a change, then the location and value after the change (ex. A1=45 followed by A1=55).
My problem starts when I try to open the resulting file. It generates, looks to be about the right size but Excel claims it is corrupted. It does try to recover what it can, but ultimately fails and the workbook won't even open. For troubleshooting, I opened up the generated xlsx and confirmed all the various XML files that make up an xlsx file were present and readable so I am concluding either something is missing or some part of the XML coming out the other side is not what Excel wants. Further troubleshooting involved creating an empty workbook (no data, 1 sheet) as my 'template', opening it and then saving it back to the file system with a different name and simply trying to see if I could open it in Excel but no dice. This has me ruling out anything to do with my attempts to write or add data to the sheet.
Relevant Environment Information:
'template' workbook is being generated on a Windows 10 64bit machine
My docx4j code is executing on a Debian 10 Linux machine running OpenJDK 11.0.4
My version of Excel both to create the 'template' and open the copy is Excel for Office365
I am running Docx4J v11.1.3 but I also tried with v8.1.5(both cases I had to use the Reference Implementation of JAXB to get around a marshalling error when trying to save)
I did see another post on Stackoverflow here about an issue related to fonts in Linux environments so I made sure to install the MS TT Corefonts but it didn't help my problem.
I ran the entire unzipped directory through BeyondCompare and there are some differences but I don't know which are just artifacts of the two different OS' or even which differences matter. Mostly they are:
small differences in file size
boolean values showing as "1", "yes", or "true" but not the same way for both files
namespaces and attributes in one file but not the other
Sheet1 from my blank workbook, before and after
All ideas are welcome.
Please try the just-released docx4j 8.1.6, which fixes handling of xlsx files created by recent releases of Excel. This was https://github.com/plutext/docx4j/issues/389

Excel 2016 Chart Axis-X not showing the correctly

I have a Excel file (.xlsm type) contains lot of Charts. After switch to Excel 2016, certain charts not showing Label correctly (axis-x).
Eg. It suppose showing WK10'17, WK11'17, WK12'17,...
but it showing 1,2,3,4,....
1) I tried to reselect the data, then the label showing correctly, but after save and reopen, it become 1,2,3,4.... again
2) also tried delete the existing chart, and create a new one in Excel 2010 & 2016, problem not solve.
3) Axis Type have been set as Text
Is this a bug in Excel 2016 ? Did anyone have a solution for this ?
Below Chart showing 1,2,3,4,..., which is wrong.
Below chart is showing correctly.
Below are my table look like
1st Experiment:
Firstly, I create a whole new file in Excel 2016. Then do below step:
- Create 4 Indicators for performance review, with dummy data
- Create new chart and format it
- Create simple VBA code to hide everything, and only show related Indicator that selected
Everything work just fine, even switching around the indicator many times.
Later, Close it and reopen, 3 out of 4 charts having Axis-x label became 1,2,3,...
2nd Experiment:
I created Whole new file in Excel 2010, with 4 indicators and same VBA code.
Then Close and reopen, Axis-x format remain Perfectly good.
Transfer the file into Excel 2016 machine. Close and reopen, the Axis-x became 1,2,3....
*** Current Excel Version 1705 (Build 8201.2075)
*** Attach with these experiment files
4Q Demo.zip
Appreciate, who got interested into this issue, have a look on my file.
Share with me, if you do have any solution for that. Thanks
I found out as long as the Chart is not hide, then the axis-x will remain correctly. But this do not really help, when hiding additional chart is a must.
Another temporary workaround method is :
1) moving the data table to another worksheet.
2) Then the set the Chart's data range to another worksheet (Cannot be the same worksheet with Chart).
That will work perfectly, now can hide the chart while maintain axis-x correctly.
**** Only drawback, table have to move or duplicate into another worksheet
**** Probably Microsoft will solve this after Version 1705 (Build 8201.2075)

SSIS export to Excel template - keep row height

I have a following excel 2007 template (.xlsx):
I have set up an SSIS process to copy that template and populate the first two columns with data as the file will be printed and then signed by order recipients. Everything is going well except for one thing - after the process populates the template with data, the cells don't retain their size - making signature cells too small.
Any ideas on how to force excel to keep the cell heights ?
One idea would be to create a macro that runs when the workbook is opened and it sets the row height using the Range.RowHeight property, here:
https://msdn.microsoft.com/en-us/library/office/ff193926.aspx
If anyone ever has a similar issue, I managed to find a workaround. Instead of using SSIS I'm using SSRS where I keep the cell height by adding an "invisible (white text on white background) column at the end. I set up an SSRS subscription to automatically export the data and send as an Excel.

Resources