Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute javascript on IIS Server (server side)

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?

like image 776
Eowendacan Avatar asked Aug 12 '26 17:08

Eowendacan


1 Answers

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.

like image 182
elolos Avatar answered Aug 15 '26 06:08

elolos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!