You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a CSV output requirement that is fighting parseCSV's unparse() method something fierce because the data is not a simple flat file, I am reporting a line then a 'subreport' table below that line and then flattening it all into a single CSV e.g.:
"Kit SKU","Name","Parts List","Price" #Main CSV
00001,Widget 1,(See Below), 12.23
,Part,Description,Supplier,Qty,Cost #Additonal Data
,PRT-001, Widget Component 1,ABC,2,0.99
,PRT-002,Widget Component 2,EEF,4,1.28
,,,,6,7.10 # Subreport totals
#Additional data is added into the main $csv->data from $subreport_csv->data.
#Line 1 mirrors the subreports headers into line [0] of the data.
#The empty first cell effectively indents the subreport table in the resulting spreadsheet
The problem I am having is the main titles are only 4 columns and parseCSV is assumingthe CSV is only 4 columns wide and truncating the additional data. When I try to use unparse() or output($file) it's screwing up the subreport data in all sorts of interesting ways, like skipping some of the columns. I have have to add 'phoney' $csv->titles[] elements in that add extra columns, but found these have to be unique and also have to contain text (I can't for example make them a blank space like " ", or just repeated "-" titles).
It would be very beneficial if I could just force parseCSV to respect the maximum width of columns in the data and override it's 'best guess' attempts which are extremely problematic.
Is this possible to dothis already? If not then could it be added?
The text was updated successfully, but these errors were encountered:
I have a CSV output requirement that is fighting parseCSV's unparse() method something fierce because the data is not a simple flat file, I am reporting a line then a 'subreport' table below that line and then flattening it all into a single CSV e.g.:
The problem I am having is the main titles are only 4 columns and parseCSV is assumingthe CSV is only 4 columns wide and truncating the additional data. When I try to use unparse() or output($file) it's screwing up the subreport data in all sorts of interesting ways, like skipping some of the columns. I have have to add 'phoney' $csv->titles[] elements in that add extra columns, but found these have to be unique and also have to contain text (I can't for example make them a blank space like " ", or just repeated "-" titles).
It would be very beneficial if I could just force parseCSV to respect the maximum width of columns in the data and override it's 'best guess' attempts which are extremely problematic.
Is this possible to dothis already? If not then could it be added?
The text was updated successfully, but these errors were encountered: