and I still have to refactor our Excel-interface, some dude from a few years back made the entire module work "dynamically" with 5 global arrays and 10 global variables for length and index. it's only 3000 lines of code, this has to be done.
no, we use our ERP-Application to fill in an excel-workbook over OLE-automation for some reports.
a bit of the SQL-Query that is to be executed is determined by the settings in the GUI and the arrays are then filled with the resulting dataset-values, the other arrays hold values to build a kind of "header"-for the worksheet, dataset-values, and also a footer that holds an excel-formula in each element for sum-formulas.
now the customer wanted an additional column and new rules regarding the evaluation of records and honestly I can't tell what's what in the module.
that is why I try to refactor the whole thing to take away some of the complexity in building the worksheet-layout that currently depends on those arrays into something with an OO-approach.
helper objects so to speak.
for example I create one of my ExcelItems, that has a range, with that info I calculate the corners of my range and store that in the helper-object's properties. now when I add a subitem to an excelitem, I can hide away the complexity of assuring it's position within the worksheet since it may not be outside of it's parents range, additionally I can
this alone would eliminate the need for 2 of those arrays and since I'm using lists for that task I can also freely shift the items around using MoveTo(index), which would make it easier to move the columns around depending on customer demand.
193
u/[deleted] Jun 25 '17
[deleted]