在IIS服务器上执行javascript(服务器端)

时间:2021-12-20 15:33:37

I have developed an asp.net application in C# . It runs on IIS Server. Users can create reports with widgets(text, values, charts etc...) . There is a date widget on the report. If users change the date, all widgets are updated using javascript in function of the date(I use AJAX to get new values). When they have finished they can save the report to see it later and they can export it to PDF using wkhtmltopdf. The problem is I would like to develop a function that allow users to ask to receive this report automatically every day, every week etc... So i would like to do a cron that refresh the date widget on each report, then update widgets to generate the report of the day? Is it possible?

我在c#中开发了一个asp.net应用程序。它在IIS服务器上运行。用户可以使用小部件创建报告(文本、值、图表等)。报告中有一个date小部件。如果用户更改了日期,所有小部件都将使用javascript在日期函数中进行更新(我使用AJAX获取新值)。当他们完成后,他们可以保存报告以便以后查看,他们可以使用wkhtmltopdf将报告导出为PDF。问题是我想开发一个功能,让用户每天、每周都能自动收到报告……所以我想做一个cron,在每个报表上刷新date小部件,然后更新小部件来生成当天的报表?是可能的吗?

1 个解决方案

#1


2  

What you need is to use a headless browser like PhantomJS, which can call the page and interact with the widgets like the user would. More information on how to run PhantomJS from C# can be found here.

您需要的是使用一个像PhantomJS这样的无头浏览器,它可以像用户那样调用页面并与窗口小部件进行交互。关于如何从c#运行PhantomJS的更多信息可以在这里找到。

#1


2  

What you need is to use a headless browser like PhantomJS, which can call the page and interact with the widgets like the user would. More information on how to run PhantomJS from C# can be found here.

您需要的是使用一个像PhantomJS这样的无头浏览器,它可以像用户那样调用页面并与窗口小部件进行交互。关于如何从c#运行PhantomJS的更多信息可以在这里找到。