BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Excel (xlsx) export #86

Closed ascheider closed 1 year ago

ascheider commented 1 year ago

Is there any template/possibility for excel export? I can only see csv, xml, html and other formats.

BlackbitDevs commented 1 year ago

Until now I could convince all clients that CSV export is enough, even for Excel ;-) In older versions there was a problem with special characters but this should be gone meanwhile (problem was that the Byte-order mark needs to be set).

Do you have any problems with CSV in Excel? Of course we could implement the template for Excel export, all the necessary libraries are available anyway. But it only needs some time.

ascheider commented 1 year ago

@BlackbitDevs No i do not have any problems. The customer and his coworkers just likes excel and works with the format everywhere. Can you please sent the estimation to: info at scope01.com (If you want to integrate it in the bundle) Thank you.

BlackbitDevs commented 1 year ago

Can you please sent the estimation to: info at scope01.com (If you want to integrate it in the bundle)

Sorry, have not seen your comment. Is your requirement still valid? We will send you the offer ASAP.

ascheider commented 1 year ago

@BlackbitDevs No problem. Yes, please send the offer. Thanks!

BlackbitDevs commented 1 year ago

@ascheider We have implemented the result callback function template for Excel export in version 3.5.x-dev. Is it ok for you to use this (not yet released) version or shall I create a separate version of 3.4 which includes the Excel template?

ascheider commented 1 year ago

@BlackbitDevs Hi, cool. the customer is currently using 3.4 If its not big effort for you, than please merge it in 3.4. Thank you!

BlackbitDevs commented 1 year ago

Is now also included in 3.4.6.

ascheider commented 1 year ago

@BlackbitDevs Hi,

i just tried to the test feature. In template selection, the excel name template name 'pim.mapping.template.rawdata_as_excel' is not translated: Bildschirmfoto 2023-07-03 um 10 27 56 Also async auto refresh request fails: image

Tested with 3.4.6 Pimcore: 10.5.23

BlackbitDevs commented 1 year ago

Sorry, forgot the translations. Have just released 3.4.7. Have successfully tested it locally. I wonder a bit about the ERR_CONNECTION_REFUSED error. If this still happens with 3.4.7, do you see any more information in the Console tab? Because I recently have fixed a bug where HTTP URLs got called for a project which is accessible only via HTTPS.

ascheider commented 1 year ago

@BlackbitDevs The translation is fixed. Thanks! i have the same problem with 3.4.7. Only this url is called with https image image

All another data director urls are correct and called with http image

BlackbitDevs commented 1 year ago

Before wasting some more version numbers, can you please try if it works now with 3.4.x-dev?

ascheider commented 1 year ago

@BlackbitDevs Tried with the 3.4 branch, which is 3.4.8, but have still the issue. Doe you have a commit link, where you fixed the https issue, then i can try to debug the problem on my machine. If i search for reloadUrl in the bundle, i do not find the place, where it's build.

ascheider commented 1 year ago

@BlackbitDevs Do you have feedback for me? Thanks!

BlackbitDevs commented 1 year ago

Should be https://bitbucket.org/blackbitwerbung/pimcore-plugins-data-director/commits/9afd0907aadb8c76d30319d5520551e179a108a6

ascheider commented 1 year ago

@BlackbitDevs Okay, got it. The function getHostUrl in htdocs/vendor/blackbit/data-director/lib/Pim/Helper.php builds url always with https. If i change self::$hostUrl = Tool::getHostUrl('https', self::getRequest()); to: if (self::getRequest()->getScheme() === 'http') { self::$hostUrl = Tool::getHostUrl('http', self::getRequest()); } else { self::$hostUrl = Tool::getHostUrl('https', self::getRequest()); } Than it works fine, if request protocol is http, http is used, otherwise like before: image Can you please integrate it in 3.4? Thanks! The excel file after fix and export look for me fine!

BlackbitDevs commented 1 year ago

Sorry, you are right. I wrongly assumed that Pimcore\Tool::getHostUrl only uses the given protocol if there is no HTTP request available. But in fact it overwrites the request's protocol. Fixed in 3.4.9.