Commit Graph

98 Commits

Author SHA1 Message Date
Ivan
24c5fca308 Update slinkees
Update of all the slinkees files with the latest version of SAPLink to
simplify merge of pull request
2015-01-12 14:55:28 -06:00
Ivan
fde89c9625 Several Fixes and Include Pull Request #350
Added the pull request #350 "Gradient Fill -> writer + demo programs 2 &
34" manually
Fixed ZEXCEL_DEMO report, bug after fix #345
Excel common has a bug, right now I used a quick and really dirty
solution
2015-01-09 18:07:01 -06:00
StefanSchmoecker
72a336253d issue #346 2nd part, #278
Changes:
ZCL_EXCEL_WORKSHEET:  New attributes to hold row-outline information
ZCL_EXCEL_WORKSHEET_ROWDIMENSI:  Look at those row-outline information.  Modified methods that refer to outlining
ZCL_EXCEL_WRITER_2007:  Respect new outlining informatino by using the modified methods from rowdimensi,  Also corrected an error that occurs if we have leading or trailing empty rows but information stored in rowdimensions
ZDEMO_EXCEL12:  Modified Demoreport 12 to demonstrate new outlining method
2015-01-03 14:50:25 +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
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
2838c93a1a Fix issue #336
Now column buffer uses always lowercase strings
2014-12-26 11:45:28 -06: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
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
c2419f3896 Code Inspector improvements
Change coding issues raised by code inspector.
Still some remain to fix.
2014-03-18 10:34:13 -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
111cf14f2d Fix issue #297 2014-03-05 14:00:00 -06:00
Ivan Femia
427ca5c4d8 Fixed #291
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@433 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-09-16 23:17:04 +00:00
Ivan Femia
5c6995fe90 Test #290
It is possible to specify a formula in the field catalog instead of a value (BIND_TABLE)

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@432 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-09-11 22:07:48 +00:00
Stefan Schmöcker
efedac0571 #284: Added support of reading XLSX-Files where the formulae are not stated explicitly but by reference to another cell holding a reference formula. Thanks to David for supplying the method to shift a formula to another cell.
Enhanced Demoreport 6 to demonstrate how this new method can be used in other circumstances then reading in an EXCEL-sheet


set to test #268:  Changed unit-test to make use of the extended functionality in ZCX_EXCEL

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@428 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-08-11 10:43:02 +00:00
Ivan Femia
e6ce67fc32 Fix an error with not characters values in set_cell method (issue #162)
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@417 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-04-09 08:01:05 +00:00
Ivan Femia
9528905a07 ready to test #162 Adding Stefan suggestion and adapting DEMO14
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@415 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-04-07 11:38:55 +00:00
Ivan Femia
7d5635ec6d Ready to test #259 Fix in classes ZCL_EXCEL_AUTOFILTERS, ZCL_EXCEL_AUTOFILTER, ZCL_EXCEL_WORKSHEET, ZCL_EXCEL_WRITER_2007 and ZCL_EXCEL_CONVERTER
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@413 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2013-04-07 10:06:59 +00:00
Stefan Schmöcker
70e0659f82 ZCL_EXCEL_WORKSHEET=>SET_TITLE
#243 : ' not allowed as first character in title of worksheet
#230 : pimp my code

also readded implementing code of interface printsettings since it seems to have been eradicated when removing the aliases

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@399 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-08 13:11:29 +00:00
Alessandro Iannacci
8612883c9a Issue #240 - Aliases (added with commit #378) removed
+
daily build including all fixes

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@394 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-06 10:37:18 +00:00
Alessandro Iannacci
5c9dde9b26 Corrupted slinkee corrected
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@392 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-06 09:51:45 +00:00
Alessandro Iannacci
408a280c2a #386 file corrupted --> re-added
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@388 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-05 12:06:33 +00:00
Alessandro Iannacci
8fb4ca103e git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@387 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 2012-12-05 12:05:41 +00:00
Alessandro Iannacci
186cd05881 changeset #378 --> re-added, sorry
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@386 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-05 11:53:02 +00:00
Alessandro Iannacci
9ec17f9a2a #236: feature completed
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@385 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-05 11:46:37 +00:00
Stefan Schmöcker
e7865e58cb set to test #235 - Print - Titles: Repeatable Rows and Columns
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@378 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-02 14:15:32 +00:00
Stefan Schmöcker
14699b93ab leave at test #227 because of minor cosmetic changes
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@376 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-01 21:07:48 +00:00
Alessandro Iannacci
1b0a69d2b3 #227
Bind Table: Overlapping tables should raise exception - FIXED

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@375 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-12-01 18:08:28 +00:00
Alessandro Iannacci
8c45483af8 git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@370 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 2012-11-29 09:00:09 +00:00
Ivan Femia
fda6f0e3eb Ready to test #163
Added range capability to worksheet

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@358 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-11-04 22:22:46 +00:00
Stefan Schmöcker
5d1bfcc2d8 Issue #225 - Correction BIND_ALV_OLE2
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@349 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-10-28 23:25:22 +00:00
Stefan Schmöcker
83269343a6 fix #226 - change of sheet title invalidates named ranges referring to this sheet
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@348 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-10-28 20:43:03 +00:00
Stefan Schmöcker
6e902d884b #179 - Add coloring of worksheet tabs ready for testing. Reader & Writer updated
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@345 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-10-23 22:23:45 +00:00
Rene Turnheim
a200b573e7 Fixed #202 issue. Added hex type to string conversion case for excel. As hex data type is not supported by Excel.
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@334 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-08-29 01:15:10 +00:00
Ivan Femia
485a7e8655 Ready to test #204 #187 #188
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@328 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-08-26 16:28:49 +00:00
Rene Turnheim
4ab796ff90 Issue #177 resolved.
Also cleaned missing exception class zcx_excel for some methods.
This change closes #177. 

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@325 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-08-10 16:21:31 +00:00
Rene Turnheim
895b5a3fb3 Issue #171 resolved. Also clean missing exception class for some methods.
This change closes #171.

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@324 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-08-10 15:55:44 +00:00
Ivan Femia
a47aea4833 Small changes to descriptions
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@317 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-06-30 20:03:35 +00:00
Ivan Femia
892d7e7cd0 ready to test
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@316 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-06-30 19:49:06 +00:00
Gregor Wolf
c3c4021446 Fixed problem introduced with Changeset 302 to fix issue #163.
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@315 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-06-29 14:27:31 +00:00
Rene Turnheim
f05f725862 issue #171 ready for testing;
New method GET_DEFAULT_EXCEL_TIME_FORMAT created.

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@313 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-05-06 22:17:37 +00:00
Ivan Femia
4ea14eee0e Fix a bug introduced with commit for issue #163
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@302 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-04-25 15:23:32 +00:00
Ivan Femia
327ef3f5f6 Ready to test #151
As for OXML specification value should be a string value
- ZCL_EXCEL_WORKSHEET only pretty printer -

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@298 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-04-25 09:27:53 +00:00
Stefan Schmöcker
b47788b58e Issue #157, 2nd topic:Allow default styles for columns, sheet or whole document
Added demoreport 36 to demonstrate this

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@292 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-04-04 22:03:54 +00:00
Stefan Schmöcker
b1d6654f42 Issue #157 - Adding methods set_row_height and set_column_width to ZCL_EXCEL_WORKSHEET
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@291 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-04-02 20:21:39 +00:00
Stefan Schmöcker
9ca303b3c1 Issue #155 - less strict typing of parameters. This time: ip_column set from ZEXCEL_CELL_COLUMN_ALPHA to SIMPLE
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@290 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-04-02 14:10:16 +00:00
Ivan Femia
2f8023e37a Changed method GENERATE_TITLE in order to use textpools
!!! Import using latest version of SAPLINK plugin ZSAPLINK_CLASS !!!

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@288 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-03-31 14:13:21 +00:00
Stefan Schmöcker
a2ca172cf0 Issue #154 - Worksheet names ( generation if not passed and checks for uniqueness and allowed characters )
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@284 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-03-27 22:46:07 +00:00
Stefan Schmöcker
57867439aa #152 - ZCL_EXCEL_WORKSHEET->SET_CELL: Don't touch existing style if only value is passed
git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@283 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
2012-03-26 22:58:40 +00:00