DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

Export to CSV with fieldnames not custom display names

Posted by nassausky 
Export to CSV with fieldnames not custom display names
September 17, 2014 09:35AM
Hi all,

Getting much done here. Maybe someone knows the trick without me having to dig around longer to find out the trick.

Question: Can I replace in the code (I guess business_logic.php) the export file to include the actual MySQL field names instead of the display names I have setup for the browse results.

Solution: Around line 5447 in business_loginc.php (I probably made a bit of corrections to that file so can't say line number)

Original:    $csv .= "\"".str_replace("\"", "\"\"", $fields_labels_ar[$i]["label_field"])."\"".$csv_separator;
Modified:	$csv .= "\"".str_replace("\"", "\"\"", $fields_labels_ar[$i]["name_field"])."\"".$csv_separator;


Sorry I got the solution posted above as I quickly went back to dig through the code a second time hoping it was as easy as it is.

Thanks,


Should I be in this forum writing programs if I have to use my fingers to count to answer the simple spam prevention security question smiling smiley
Re: Export to CSV with fieldnames not custom display names
September 19, 2014 12:48PM
nassausky Wrote:
-------------------------------------------------------
> Hi all,
>
> Getting much done here. Maybe someone knows the
> trick without me having to dig around longer to
> find out the trick.
>
> Question: Can I replace in the code (I guess
> business_logic.php) the export file to include the
> actual MySQL field names instead of the display
> names I have setup for the browse results.

Ok, so I think you got a working solution, right?


> Should I be in this forum writing programs if I
> have to use my fingers to count to answer the
> simple spam prevention security question smiling smiley

Ahah, maybe not! smiling smiley

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: Export to CSV with fieldnames not custom display names
September 19, 2014 01:45PM
Yes thanks it's working great. Just working on a C# app now to import that CSV data into MS Access for a mail merge. Just hung up there scratching my head with trying to not get an error returning an ADOX.DataTypeEnum with parameters. http://stackoverflow.com/questions/25900156/passing-a-datatypeenum eye popping smiley
Sorry, only registered users may post in this forum.

Click here to login