Jump to content


Export with relations not showing data

export relations

  • Please log in to reply
5 replies to this topic

#1 arve

arve

    Newbie

  • Advanced Member
  • Pip
  • 8 posts
  • LocationNorway

Posted 05 September 2017 - 12:38 PM

Hi everyone, 

 

When I do a export, I only see the ID and not the data in the export file from Excel. 

 

All the code and the CRUD is working just fine, only the export excel file that doesn't work. 

 

Any ideas?

 

Thanks. 

Attached Thumbnails

  • export_excel_view_issue_1.png

Best Regards

Arve


#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 06 September 2017 - 04:39 AM

Can you share the code that you using in the controller ...

cuz i just cross checked this example on the site itself..

https://www.groceryc.../set_a_relation

and if you notice there - the export dose get the office names rather then office ids. 

I am sure you might have put it under certain criteria like listing or so and hence you might have issues generating the export with relation data.

 

Also, please share in - what version of GC you are using for the same.

Once you share the code, will be able to guide you to a possible solution apart from just assuming. 

 

Happy GCIng :)



#3 arve

arve

    Newbie

  • Advanced Member
  • Pip
  • 8 posts
  • LocationNorway

Posted 06 September 2017 - 06:15 AM

Hi, 

 

I'm using CI 3.1.5 with GC Enterprise 2.3.2. 

    public function computers() {
        //Setting variable and loading library.
        $crud = $this->_getGroceryCrudEnterprise();

        $crud->setTable('tbl_datasys_computers');
        $crud->setSubject('Computers');

        $crud->displayAs('computer_hostname', 'Hostname');
        $crud->displayAs('computer_sn', 'SN');
        $crud->displayAs('computer_brand', 'Brand');
        $crud->displayAs('computer_model', 'Model');
        $crud->displayAs('computer_employee', 'User');
        $crud->displayAs('computer_vendor', 'Vendor');
        $crud->displayAs('computer_comment', 'Comment');

        //Unsetting columns that are not for the regular CRUD
        $crud->unsetColumns(['computer_id', 'computer_ram', 'computer_cpu', 'computer_warranty', 'computer_mac_wlan', 'computer_mac_lan', 'computer_windows_license', 'computer_hdd', 'computer_bought_date']);
        $crud->setRelation('computer_employee', 'tbl_employees', '{employee_lastname}, {employee_firstname}');
        $crud->setRelation('computer_brand', 'tbl_datasys_brands', 'brand_name');
        $crud->setRelation('computer_vendor', 'tbl_datasys_vendors', 'vendor_name');
        
        //Setting order_by
        $crud->defaultOrdering('computer_hostname', 'asc');

        //Redering and sending data to view.
        $output = $crud->render();
        $this->_crud_output($output);
    }

The export is using ID's but at print its correct.. Hmm.. 


Best Regards

Arve


#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 06 September 2017 - 12:13 PM

OOhh ... well the Community Edition dose have proper working 

Sorry .. am not aware of the bug in the enterprise edition



#5 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,137 posts
  • LocationLondon

Posted 08 September 2017 - 03:20 AM

Hello guys,

 

This is a bug at the enterprise version and it will be fixed on the next release (version 2.3.3). I will inform this forum thread as well once this is done.

 

Regards

Johnny


Posted Image

#6 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,137 posts
  • LocationLondon

Posted 11 September 2017 - 07:16 AM

Hello guys,

 

The version 2.3.3. is now available with this issue fixed. Thanks @arve for informing us for this bug.

 

Enjoy :)

Regards

Johnny


Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users