0

So i have to create a XLSX File in this structure:

PAYMENT CUSTOMER    DT_CRIACAO          KEY_ORIGEM               VL_LIQUIDO
6129385 5026977    29/06/2017 00:00:00  AR_PREV-6129385/14634986    186,48
6129385 5026977    29/06/2017 00:00:00  AR_PREV-6129385/14634985    -35,52
6139889 5033198    29/06/2017 00:00:00  AR_PREV-6139889/14679162    492,94
6139889 5033198    29/06/2017 00:00:00  AR_PREV-6139889/14679163    -93,89

But when i create the file the ',' on VL_LIQUIDO splits and turn into a new column like this:

PAYMENT CUSTOMER    DT_CRIACAO          KEY_ORIGEM                VL_LIQUIDO    
6129385 5026977     29/06/2017 00:00:00 AR_PREV-6129385/14634986    186    48
6129385 5026977     29/06/2017 00:00:00 AR_PREV-6129385/14634985    -35    52
6139889 5033198     29/06/2017 00:00:00 AR_PREV-6139889/14679162    492    94
6139889 5033198     29/06/2017 00:00:00 AR_PREV-6139889/14679163    -93    89

My Code is right, it is creating the file but something with this ExcelPackage lib is wrong cause is spliting the VL_LIQUIDO into 2 colums instead of 1.

Anyone already face a problem like this?

Lucio Zenir
  • 365
  • 2
  • 8
  • 18

1 Answers1

0

So i found a working solution:

//using this i force the delimiter to be some char that i want.
            var format = new OfficeOpenXml.ExcelTextFormat();
            format.Delimiter = 'ยบ';
            format.TextQualifier = '"';
            format.DataTypes = new[] { eDataTypes.String }; 

//This calls the load using the format i want.
worksheet1.Cells[i, y].LoadFromText(item, format);
Lucio Zenir
  • 365
  • 2
  • 8
  • 18