Commit Graph

493 Commits

Author SHA1 Message Date
StefanSchmoecker
f60604601a #345: Dump on small page margins corrected
#258:  Added dummy default emailaddress to ZDEMO_EXCEL_OUTPUTOPT_INCL
Enhanced Demoreport 37 to pass information about uncaught exceptios when needed
2014-12-31 11:48:08 +01:00
StefanSchmoecker
ae05df3842 issue #344 - Added missing exception-class in method definition 2014-12-31 10:24:09 +01:00
StefanSchmoecker
e5c352c6d5 Fixes for issues: 339,340,343
Allow inheritance to support testing of modified classes w/o having to change the original or to allow customer-specific variations
Changed objects:  
  ZCL_EXCEL_READER_2007: Added try-catch block to allow reading excelsheets with textfields ( ignore textfields - just read the rest )
  ZCL_EXCEL_READER_2007: Added support of reading hyperlinks
  ZCL_EXCEL_WRITER_2007: Corrected method CREATE_XL_SHEET_RELS to not look at internal hyperlinks
  ZCL_EXCEL:  Allow inheritance to test changes on subobjects w/o changing original ( needed for issue 343 for class ZCL_EXCEL_WORKSHEET )
  ZCL_EXCEL_WORKSHEET: Allow inheritance, Changed row-dimensions to hashtable, added tabletype for this, changed method GET_ROW_DIMENSION to use hashtable
  ZCL_EXCEL_WRITER_XLSM: Allow inheritance
  ZDEMO_EXCEL_OUTPUTOPT_INCL:  Changed default to "Display", Allow using any writerclass that inherits from ZCL_EXCEL_WRITER_2007
  ZDEMO_EXCEL37:  Allow passthrough of .xlsm files as well.  Allow using any reader or writerclass that inherits from the ZCL_EXCEL_READER_2007 or ZCL_EXCEL_WRITER_2007
  ZDEMO_EXCEL41:  Test inheritance - demo for inherited ZCL_EXCEL or ZCL_EXCEL_WORKSHEET
2014-12-29 17:20:09 +01:00
Ivan
6282d79d9e Updated version 2014-12-26 12:41:50 -06:00
Ivan
d907898fb6 New Daily Build
ABAP2XLSX_V_7_0_2.zip => SAP codata and cofile
ABAP2XLSX_V_7_0_2.nugg.zip => SAPlink nugg file

Fixes for: #326, #329, #336, #295, #337, #333
2014-12-26 12:39:22 -06:00
Ivan
01739b8676 Merge pull request #333 from oliver-huetkoeper/master
Ignore merged cells when calculating column width
2014-12-26 12:26:35 -06:00
Ivan
a44a9f4305 Merge pull request #337 from HannesRempel/master
backwards compatibility
2014-12-26 12:23:20 -06:00
Ivan
bb5b3553aa Add demo 40 to the demo gallery 2014-12-26 12:12:17 -06:00
Ivan
5068ded2fc Fix issue #295
Thanks to Marco Remondini
2014-12-26 12:10:54 -06:00
Ivan
2838c93a1a Fix issue #336
Now column buffer uses always lowercase strings
2014-12-26 11:45:28 -06:00
Ivan
83c736184e Adding enhancement category
To avoid warning during the activation
2014-12-26 11:15:27 -06:00
oliver-huetkoeper
a74220e25f Add sheet for merged cells
I have added a new sheet to demonstrate that merged cells are ignored when using auto-size (MS Excel like behaviour).
2014-11-14 09:35:57 +01:00
oliver-huetkoeper
3cfb536b02 Add test method for is_cell_in_range 2014-11-14 09:32:08 +01:00
Hannes Rempel
23858bdf03 backwards compatibility 2014-10-29 13:30:48 +01:00
Gh14Cc10
27b3467a8e Fix issue #329 - attribute indexed of bgcolor
Fix issue #329 - Wrong initial value (check) for attribute indexed of
bgcolor. Needed new daily build
2014-10-17 10:44:26 +02:00
Gh14Cc10
bed9584513 Fix issue #326 - Leading Blanks are not shown
Fix issue #326 - Leading Blanks are not shown
Daily build needed from TIR
2014-10-15 12:16:03 +02:00
oliver-huetkoeper
248ed862d4 Add method to check if a cell is within a range 2014-10-02 08:28:47 +02:00
oliver-huetkoeper
21a63fd96e Ignore merged cells when calculating column width
When calculating column width cells that are merged should be ignored. This is MS Excel behavior and should be handled similar in ABAP2XLSX.
2014-10-02 08:10:42 +02:00
oliver-huetkoeper
c31528604e Add method to check if a cell is merged 2014-10-02 08:05:55 +02:00
Ivan
c31b7117c7 New Daily Build
ABAP2XLSX_V_7_0_1.zip => SAP codata and cofile
ABAP2XLSX_V_7_0_1.nugg.zip => SAPlink nugg file
2014-09-29 22:50:55 -05:00
Ivan
f1e73cd29e Using constant for versioning and moving to version 7.0.1
What's new?
Added versioning management
2014-09-29 22:41:42 -05:00
Gh14Cc10
fc13acd974 Added ABAP2XLSX Version in the Excel properties - missing file
Added ABAP2XLSX Version in the Excel properties - missing file
2014-09-29 18:38:08 +02:00
Gh14Cc10
e50da3a3fa Added ABAP2XLSX Version in the Excel properties - missing file
Added ABAP2XLSX Version in the Excel properties - missing file
2014-09-29 18:31:56 +02:00
Gh14Cc10
6c8c15ab9e Added ABAP2XLSX Version in the Excel properties
Added ABAP2XLSX Version in the Excel properties
2014-09-29 17:30:10 +02:00
Gregor Wolf
0d902526bd Revert "💥🐫 Added .gitattributes & .gitignore files"
This reverts commit 19d7d97347.
2014-09-13 18:47:35 +02:00
Gregor Wolf
19d7d97347 💥🐫 Added .gitattributes & .gitignore files 2014-09-13 18:47:14 +02:00
Gregor Wolf
ae56d3749b Fix issue #332 strlen used directly in expression should not be used to keep support for AS ABAP < 7.02
Additional fix for #331
2014-09-13 18:35:28 +02:00
Gregor Wolf
8e8dd7145d Fix issue #331 - replace pragma ##NO_HANDLER with "#EC NO_HANDLER 2014-09-11 19:45:48 +02:00
Ivan
5fe3e01419 New daily build
It contains fixes for issues #328 and #325
2014-08-27 14:36:24 -05:00
Ivan
03fda13182 Autofilter switch on table object
Addithe possibility to deactivate autofilter on table object.
See DEMO3
2014-08-27 14:24:44 -05:00
Ivan
59fe79ecfe Merge pull request #328 from oliver-huetkoeper/patch-1
Get style id from mapping table (column style)
2014-08-27 13:52:09 -05:00
Ivan
9c4be2d3a1 New Daily build
including latest commits
2014-08-27 13:38:43 -05:00
Ivan
4229e98726 Enhancing DEMO7
Adding ColorScale and DataBar conditional formatting examples
2014-08-27 12:29:46 -05:00
Ivan
9b5cf42123 Fix issue #330
Adding ColorScale Conditional formatting
2014-08-27 11:23:28 -05:00
oliver-huetkoeper
a19bd1d984 Get style id from mapping table (column style)
Global mapping table styles_mapping should be used for column styles as well. It is already used for other styles.
2014-08-20 10:51:55 +02:00
Rüdiger Plantiko
501aa04f22 Update ZIF_EXCEL_READER.slnk
Finally removed method CAN_READ_FILE from the interface ZIF_EXCEL_READER
2014-07-05 17:11:02 +02:00
Rüdiger Plantiko
31021ebe95 Update ZCL_EXCEL_READER_2007.slnk
- Switched back to language 'E'
2014-07-05 17:09:06 +02:00
Rüdiger Plantiko
976bedb120 Reader Refact & INCOMPATIBLE remove CAN_READ_FILE
1. Removed interface method ZOF_EXCEL_READER~CAN_READ_FILE
As was suggested in the comments, the method ZIF_EXCEL_READER~CAN_READ_FILE is superfluous, as the exception ZCX_EXCEL in LOAD( ) / LOAD_FILE( ) already gives this information. 

This is an incompatible change! But it's unlikely that this method is used by many clients, as it didn't to anything useful. Also, the demo programs don't use it.

2. Switched the zip archive reader creation from the former "on demand" creation to a one-time creation in the LOAD method. Necessary for the next point:

3. Removed private attribute EXCEL2007 (which kept the input XSTRING): After generation of the zip archive, these data are not necessary any more.

4. Factored out Stefan Schmöcker's "alternate zip" concept into a local subclass: The object "zip" refers to a local class - which is either a proxy to CL_ABAP_ZIP, or creates a zip object of dynamic type and calls its GET method of a class dynamically (the "alternate zip" case).

Depending on the answer of my question 

https://github.com/ivanfemia/abap2xlsx/issues/232#issuecomment-42115340

this abstraction could be removed in a forthcoming commit as soon as it has been clarified that CL_ABAP_ZIP works as expected in all cases.

5. Further cleaning.- Removed some comments like "ToDo: Comment this" if necessary, and also some misleading comments which gave unwanted attention to a certain defect (issue 234) and the circumstances of that defect, thereby obfuscating the far more general nature of the commented code.
2014-05-07 15:19:00 +02:00
Gregor Wolf
137e0ec960 Merge branch 'master' of https://github.com/ivanfemia/abap2xlsx.git 2014-05-02 22:59:15 +02:00
Gregor Wolf
c8fee653ca Recover Unit Tests from previous version and fix issue #318 2014-05-02 22:57:37 +02:00
Ivan
d244c06108 Merge pull request #319 from rplantiko/master
Fixed a bug in shared string table reading
2014-05-02 15:32:47 -05:00
Rüdiger Plantiko
37671d6ad7 Fixed a bug in shared string table reading
There was a book in reading strings from the SST, caused by not catching the "node value" event in the main loop. Shared strings could point wrongly to the first table element (which usually contains the empty string).
2014-05-02 22:26:13 +02:00
Gregor Wolf
7dcee8edeb Enhance report ZDEMO_EXCEL31 to show better autosize function from issue:
#310 More sophisticated calculation of cell widths
2014-05-02 22:08:26 +02:00
Ivan
1409cf8741 New Daily Build 2014-03-18 10:43:04 -05:00
Ivan
c2419f3896 Code Inspector improvements
Change coding issues raised by code inspector.
Still some remain to fix.
2014-03-18 10:34:13 -05:00
Ivan
d44d88a13a Merge pull request #310 from chrassig/patch-1
More sophisticated calculation of cell widths
2014-03-14 10:38:59 -05:00
chrassig
55ac5af43b More sophisticated calculation of cell widths
Let me start by saying we really love the ABAP2XLSX project. Compared to exporting CSV files and importing them to Excel, it makes transferring data from SAP systems to Excel and vice versa so much easier.

What we did not like so far was the optimization of column width, especially because of the way this is realized in the XLSX file format (why did they not just add an attribute "optimize column width = true"?). Anyway, ABAP2XLSX being an open source project, we decided to try to bring some progress to this feature.

We ended up rewriting the method CALCULATE_CELL_WIDTH of the class ZCL_EXCEL_WORKSHEET.

We added the following features:
a) Before, the calculation of the cell width in ABAP2XLSX did not take into account the fact that Excel uses a proportional font by default. Thus, columns with many "i"s ended up too wide, while columns containing many "W"s ended up not wide enough.

We now use the function module LOAD_FONT, contained in SAP package BC. Thus, it should be available in pretty much every SAP system that runs ABAP. LOAD_FONT returns an internal table containing the width of every letter known in a font. You can upload Excel's default font Calibri using transaction SM73. Make sure to upload all four files (standard, bold, italic, bold and italic) and to use the description "Calibri", i.e. exactly the name Excel displays for the font. If you want to use other fonts in your files created by ABAP2XLSX, you can of course upload other fonts as well.

We calculate the sum of the widths of all characters in a cell, and add some cell padding, similar to the way Excel does it. If the font is not available in your SAP system, we revert back to a logic similar to the old one.

As calling LOAD_FONT for every cell took several seconds when we tested with larger tables, we store the values read from the function in a hash table. Thus, we only have to call the function once for every combination of font name and font attributes used in your Excel file.

b) XLSX stores dates in a cryptic format. For dates, the current implementation calculates the width of the cryptic values, thus, the columns end up too narrow.

Fortunately, ABAP2XLSX already contains a method to transform the cryptic value into an ABAP date. We then use ABAP's WRITE statement to create a date in the format the user is preferring, and calculate the width of this formatted date.

c) ABAP2XLSX currently does not consider auto filters. Thus, a column may end up too narrow, not showing the complete header text.

We fixed this by adding a fixed value to the cell width if an auto filter is activated. We use a fixed value because the size of the auto filter button in Excel does not depend on the font size you use.

d) ABAP2XLSX only estimates the width of the characters. Excel adds a small fixed amount to the width of the characters to create some horizontal cell padding. We added cell padding as well, as this brought the cell width even closer to the values calculated by Excel.

e) ABAP2XLSX already uses ABAP's data type FLOAT to store the width of a cell. However, CALCULATE_CELL_WIDTH used data type I (integer) to calculate the cell width before. Changing the parameter type for the parameter EP_WIDTH from I to FLOAT, and adjusting the variable used by the calling method CALCULATE_COLUMN_WIDTHS in the same way, made the calculation even more precise.
2014-03-14 16:15:09 +01:00
Ivan
76bb151bbb Fix issue #308
Changed returning parameter  of method PIXEL2EMU from INT4 to STRING
2014-03-13 12:16:32 -05:00
Ivan
f52ace103a New daily build
Web Dynpro Examples are now in a separated nugget (extra)
2014-03-07 09:10:00 -06:00
Ivan
686f5c946b New daily build 2014-03-05 14:07:39 -06:00