I need to add a custom report to the UI in the report section, I've gotten as far as creating my ApiController which inherits from ReportController and I am now trying to get my report added to a new tab but have had no success in locating an extension point to achieve this.
I have found a function called createReportsTabs in merchello.model.js but in order to avoid future upgrade issues I wanted to ask if there was another way for me to register my report without modifying core files?
Thanks to some guidance from Rusty and for anyone else that might be considering this, I managed to implement this particular requirement by means of a custom directive which I added to the existing Abandoned baskets report. This then required adding a single line with my directive to abandonedBasket.html.
I didn't find any documentation and still want to explore in more depth what's involved. I started picking apart existing reports and got the basics of my report put together but got stuck at the point of trying to add my report to the reports section. I think there is some work required in the core to make this possible in the future without having to alter core files.
After speaking to Rusty he advised me that to fulfil my particular requirement, in this case, it would be much quicker and easier to create my own directive as I was essentially adding to the existing Abandoned Basket report.
I have a growing number of blog posts I need to write up to document my own findings of things related to this project for my own future reference but to also help anyone else coming to this project from new.
It's quite a while ago now but I think I ended up dissecting an existing report to achieve my goal. Plug & Play was not an option but I needed to amend the data in an existing report and extend another. From memory, the sales reports included unpaid invoices which I needed to exclude which is why I needed to make changes.
Adding a custom report
Hi Rusty,
I need to add a custom report to the UI in the report section, I've gotten as far as creating my ApiController which inherits from
ReportController
and I am now trying to get my report added to a new tab but have had no success in locating an extension point to achieve this.I have found a function called
createReportsTabs
inmerchello.model.js
but in order to avoid future upgrade issues I wanted to ask if there was another way for me to register my report without modifying core files?Thanks, Simon
Thanks to some guidance from Rusty and for anyone else that might be considering this, I managed to implement this particular requirement by means of a custom directive which I added to the existing Abandoned baskets report. This then required adding a single line with my directive to abandonedBasket.html.
Cheers, Simon
Hey Simon, did you find any documentation on extending the report section? Or any other helpful advice from Rusty? Thanks.
Hi Trevor,
I didn't find any documentation and still want to explore in more depth what's involved. I started picking apart existing reports and got the basics of my report put together but got stuck at the point of trying to add my report to the reports section. I think there is some work required in the core to make this possible in the future without having to alter core files.
After speaking to Rusty he advised me that to fulfil my particular requirement, in this case, it would be much quicker and easier to create my own directive as I was essentially adding to the existing Abandoned Basket report.
I have a growing number of blog posts I need to write up to document my own findings of things related to this project for my own future reference but to also help anyone else coming to this project from new.
Cheers, Simon
Thanks Simon. I might look into it when I have some time and do a pull request to change the core to allow you to plug in custom reports.
Hi All
Has anyone had any luck creating custom reports?
Thanks, Sam
Hi Sam,
It's quite a while ago now but I think I ended up dissecting an existing report to achieve my goal. Plug & Play was not an option but I needed to amend the data in an existing report and extend another. From memory, the sales reports included unpaid invoices which I needed to exclude which is why I needed to make changes.
Consider looking at:
See
https://github.com/Merchello/Merchello/tree/dc2e78b18e86f32e7cb0e244b20c0521c1e16105/src/Merchello.Web/Editors/Reports
https://github.com/Merchello/Merchello/blob/dc2e78b18e86f32e7cb0e244b20c0521c1e16105/src/Merchello.Web.UI.Client/src/common/resources/salesovertime.resource.js
https://github.com/Merchello/Merchello/blob/dc2e78b18e86f32e7cb0e244b20c0521c1e16105/src/Merchello.Web.UI.Client/src/common/resources/salesovertime.resource.js
https://github.com/Merchello/Merchello/tree/dc2e78b18e86f32e7cb0e244b20c0521c1e16105/src/Merchello.Web.UI.Client/src/views/reports
I hope that helps and sorry I can't be more specific!
is working on a reply...