Hi all,
I have a form what exports data to excel. Is any way how to merge 2 columns from DB 1 column in exported file?
thx
I have a form what exports data to excel. Is any way how to merge 2 columns from DB 1 column in exported file?
thx
Hi homeopat,
The simplest way - if the table is not too big - is to load the data into memory using a DB Read action; process the results to merge the columns with a Custom Code action; then do the CSV Export.
Bob
The simplest way - if the table is not too big - is to load the data into memory using a DB Read action; process the results to merge the columns with a Custom Code action; then do the CSV Export.
Bob
Hi Bob,
do you mean something like this?
do you mean something like this?
<?php
$temp = $form->data['zakladni']['0']['zakladni']['ulice']." ".$form->data['zakladni']['0']['zakladni']['c_orientacni'];
$form->data['zakladni']['0']['zakladni']['ulice']=$temp;
?>
but ['zakladni']['0']['zakladni'] is static way of processing, how write it dynamically?
Hi homeopat,
I'd do it with a loop something like this
Bob
I'd do it with a loop something like this
<?php
foreach ( $form->data['zakladni'] as $k => $v ) {
$form->data['zakladni'][$k] = $form->data['zakladni'][$k]['zakladni']['ulice']." ".$form->data['zakladni'][$k]['zakladni']['c_orientacni'];
}
?>
Bob
thank you, I have devised own:
but your code is better🙂
$i=0;
while (isset($form->data['zakladni'][$i]['filialka_id']))
{
$temp = $form->data['zakladni'][$i]['ulice']." ".$form->data['zakladni'][$i]['c_popisne'];
$form->data['zakladni'][$i]['ulice']=$temp;
$i++;
}
but your code is better🙂
This topic is locked and no more replies can be posted.