⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

What was used to create the Export code?



richb201
  • profile picture
  • Member

Posted 11 February 2018 - 16:52 PM

I have a table and I download it with the built in Export button. But when I take a look at the Hex for the first 8 bytes of the file (just as phpSpreadsheet does when looking for the OLE signature), it is not there! This means I cannot upload the data that Grocery Crud has exported back into my GC application. I am using phpSpreadsheet since phpExcel was deprecated.  It took a while where I couldn't imagine why the xls file created by GC could not be used by phpSpreadsheet. phpSpreadsheet looks at the first 8 bytes of an xls (or xlsx) file to determine if it is real. I don't know why it checks this again since it already checked the MIME, but whatever. 

 

 

I figure if you could point out the code that does the creation of Export I could figure out how to get the OLE signature onto the front of it. How can I fix this? My plan is to have a user export their crud to their own PC so that they can edit/maintain it in Excel and then upload it back to GC where i will merge it with the existing table. The table can be pretty large with up to 300 records. 


Amit Shah
  • profile picture
  • Member

Posted 16 February 2018 - 04:48 AM

The core export to excel is in the GC library is set on _export_to_excel function.

 

The GC library was built up - long ago. .. and the purpose was not much to build up core spreadsheets.. so a generic version of the code is built on the same - Either you can hack in the core system to build your own code to export 

 

Or - you can extend the library and add your own code for export without hacking the existing system.

 

Happy GCing :)