db read and Export the result in excel

webcrea 07 Jul, 2017
Hi

I try to export a result from db read to excel file

in debug the data are in the $data

[0] => Array
        (
            [enr] => Array
                (
                    [student_first_name] => MagPing
                    [student_last_name] => Chanff
                )

        )

    [1] => Array
        (
            [enr] => Array
                (
                    [student_first_name] => Chucent
                    [student_last_name] => Leeeu
                )

        )

    [2] => Array
        (
            [enr] => Array
                (
                    [student_first_name] => Joyn
                    [student_last_name] => Kn
                )

        )
in db read
the model ID is det and relation model is enr
fields list : enr.student_first_name,enr.student_last_name

I tried several model but always :

[XLS Export] => No data could be loaded or found, please check your action settings.

in XLS export
data path : data.enr or enr or det or det.enr....

thanks
GreyHead 08 Jul, 2017
Hi Christophe,

I think that the data structure needs to be like
[enr] = Array (
  [0] => Array(
    [student_first_name] => Chucent
[student_last_name] => Leeeu
  )'
  [1] => Array(
. . . 

Bob
webcrea 09 Jul, 2017
Hello Bob,

Sure, it should be better, why a read date return the data like this ?

Thanks
Christ
GreyHead 10 Jul, 2017
Hi Christophe,

Normally you can use the data from a DB Read with no problems - maybe something in the way you have the action configured?

Bob
This topic is locked and no more replies can be posted.