Reputation: 147
Any one have an idea on how to add new parameters to reports in Kentico 9 I want to add from-to date parameters in Top customers by number of orders report but I don't know how to implement it?
I've checked Kentico DOC but still I can't customize it, I can only add new fields but don't have idea how to link it with the query.
Also need to know if it possible to export only report to send it for importing it on another server?
Upvotes: 0
Views: 162
Reputation: 838
To add from date and to date parameters for the Top customers by number of orders report:
FromDate
, of the Date and time type. Set the field caption, as well. Click SaveToDate
field, similar to step 2table
in the Tables dropdown, click on the ellipsis button, and click Edit
AND (OrderDate BETWEEN COALESCE(@FromDate, CAST('1753-1-1' AS DateTime)) AND COALESCE(@ToDate, CAST('9999-12-31' AS DateTime)))
The full query would look something like this:
SELECT . . .
WHERE . . .
AND (OrderDate BETWEEN COALESCE(@FromDate, CAST('1753-1-1' AS DateTime)) AND COALESCE(@ToDate, CAST('9999-12-31' AS DateTime)))
GROUP BY . . .
This will add a condition to filter orders that have an OrderDate
between FromDate
and ToDate
(which are selectable from the report filters). COALESCE
is there to convert NULL
values to minimum/maximum dates, in case some date filter values are not set.
Also, to export a report, simply right-click the table header, and choose the export format that is the best fit for your needs.
Upvotes: 2