Export as Excel File

We want to add ā€œGenerate Excel Reportā€ button under Action dropdown in the opportunity module.

Is it possible to create this export as excel functionality in the module?

How to do it? Are there any addons?

Yes, there are add-ons for this, search the SuiteCRM store

Thank you I will search for it.

But, is it possible to create my own entryPoint and create excel export functionality?


Yes,me and my colleague created a custom entry point for custom reports and we are working on making exports for Excel Format, we are using the PhpSpreadsheet Library to make it possible

1 Like

If they did it, you can do it also. There are free PHP libraries that you can use to work with Office file formats (which are open and public).

However I would recommend that you consider a different approach which I predict will be much, much easier.

Simply create an OBDC data connection in Excel to consume the SuiteCRM database as an external source, and then do everything inside Excel, using VBA if necessary.

2 Likes

Thatā€™s interesting. Are you guys developing it for v7 or v8?

Looks like it needs at least PHP 8.1 :melting_face:

Thatā€™s a good idea. I need to check it out. :grin: thanks a lot! :+1:

For V8.5+, need to update the PHP first to 8.2 because of other libraries tho,but for the Default Installation already deployed with PHP 8.1.31 and SuiteCRM V8.8.0 .

Also had this question for a long time, what keeps users from upgrading from V7+ to V8 ? Is it about compatibility Matrix?

Mostly two things, I would say:

  • missing functionality: if you need that one button that v7 has, and v8 doesnā€™t, then you donā€™t upgrade
  • customizations that are hard to upgrade to the new version, namely, anything that messes with the front-end, javascript hacks, etc.
1 Like

If we want a simple export functionality to just write database queried data in an excel file using a SQL query, we can use phpoffice/phpspreadsheet package.

The following steps may help to achieve this implementation.

  1. Install the composer package phpoffice/phpspreadsheet.
  2. Add a new entry point in the legacy.
  3. Add a new bulk action in the list view of the required module.
  4. Add a process handler for the bulk action. The process handler will hit the entry point which will take the name of the module and query the database table using a configured SQL query and write into a new downloadable excel file.

Do we use process handler in v7.x too?

My bad, I didnā€™t look at the version. Have you found the code? Thanks!

No, I did not find the code. Also, I have PHP 7.4 and phpspreadsheet at least need PHP 8.1 and above.

This may not be a great idea. If it is a must have feature, building an API that would generate a file using ā€˜phpspreadsheetā€™ package with PHP >=8.1 and return it to the current Suitecrm 7 application may help.