Need to save custom kentico reports on some shared location as a scheduler task

Namita Patil asked on November 9, 2021 21:14

Hi,

I am working on one functionality where I need to create custom reports on the basis of form data. All these custom report files, I need to save at some shared location on daily as well as Monthly basis. We will be displaying these reports on Tableau dashboard, but ideally we will be accessing these files from that shared location where these reports are saved.

We will have multiple custom reports created in Reporting menu, maybe around 30-35 csv/excel files.

I have below questions:

  1. Can I use the custom Scheduler Task, where I can save the files at particular shared location? Or does Kentico provides any automated way which we can use to save all these custom reports on daily/monthly basis at specific configurable time?

  2. Is there any way where I can merge all the reports in one excel file as a separate sheet?

  3. Are there any performance issues if we save these all 30-35 files in one file?

Thanks in advance!

Namita Patil

Recent Answers


vasu yerramsetti answered on November 18, 2021 20:07 (last edited on November 18, 2021 20:09)

  1. Can I use the custom Scheduler Task, where I can save the files at particular shared location? Or does Kentico provides any automated way which we can use to save all these custom reports on daily/monthly basis at specific configurable time? - You can go with Custom Scheduler task and you can share same server or remote location, this depends on your project architecture. Kentico will not provide any automated way save or trigger reports
  2. Is there any way where I can merge all the reports in one excel file as a separate sheet? You can do this with custom code and Reports data is storing on database -> Table is [Reporting_SavedReport]
  3. Are there any performance issues if we save these all 30-35 files in one file? Yes and its depends on file size.

Reference API for Reporting -

https://docs.xperience.io/api11/configuration/reporting#Reporting-toc

https://docs.xperience.io/k12sp/integrating-3rd-party-systems/kentico-rest-service/getting-data-using-rest

0 votesVote for this answer Mark as a Correct answer

Namita Patil answered on November 18, 2021 20:35

Hi Vasu,

Thanks you so much for your response!

Now, if we have already created suppose 10 custom reports in one of the Report Category inside the Admin website -> Reporting module, which has FromDate and ToDate as a parameters for each report, then how can I pass those parameter's value though the code and execute the report programmatically to save the excel/csv file with some specific file name at some predefined location?

I couldn't see any method which accepts the report parameters to execute the already created custom report in Reporting module. Can you please provide more details on the exact method name which I should be referring to?

Thanks in advance!

Namita

0 votesVote for this answer Mark as a Correct answer

Namita Patil answered on November 19, 2021 18:44

Hi Vasu,

Thanks for all the details! It is very informative.

Now I can see different option to do this functionality to work

1) By taking data through below rest api url as data is saved in forms table. Then save this data to Excel/CSV format on some shared location.

https://localhost/rest/bizformitem.bizform.<Form-code-name>?where=FormInserted BETWEEN '2021-01-30T11:54:13.3956969-07:00' AND '2021-08-30T11:54:13.3956969-07:00'

2) By using Kentico provided classes like ReportInfo, ReportInfoProvider or ReportCategoryInfoProvider? Where I can use Reporting_SavedReport table to get data from rest api.

I have couple of questions here:

  1. As you have suggested 2nd option - but here if we save the report, it will keep adding the report html data in Reporting_SavedReport table and then we can attach the file created from the html saved in the table. But this way it will impact the performance of DB - as we will be creating almost 34 reports daily and monthly basis and it will be lot over the period. So, I am just thinking if I can delete the saved report record once attached and saved at shared location, hope its correct way?

  2. Is there any direct way where I can create the excel/csv file as and attachment through the code directly without saving it in DB?

  3. If I go with 1st option - I just have to create the excel/csv file and save it, do you think this is better way in our used case?

Thanks! Namita

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.