Last post Dec 28, 2017 05:43 PM by mgebhard
Dec 28, 2017 11:35 AM|Diana4|LINK
Hi, I have written an asp.net web application, using C# for code behind. In this web application, I have numerous web forms, each of which have submit buttons. Each of these submit buttons, when clicked by a user of the web
application, generate some asp.net charts & tables after fetching data from a database.
Now, I want to be able to get the charts and tables, not by a user clicking the submit button, but by another program (external). This external program will be something I can maybe schedule to run automatically and periodically
using windows task scheduler. I also want to be able automatically capture the charts generated by the submit clicks. Maybe as .png images. Before clicking submit on a web form, a user makes some selections on the web form. Any external program I write should
be able substitute web form user selections with its own selections, picked from reading a database.
Is there a way to do that ? can you please point me to some article which explains how such a thing can be done ? I can always write a new application from scratch, which gets data from a database, and generates *.png charts
etc, without involvement of a user. But I want to leverage all the code already written in the web application, and not have to re-write it. Just want to re-use it.
Thank you. Any Help/suggestions will be appreciated.
Dec 28, 2017 01:03 PM|mgebhard|LINK
.NET has the HttpClient, as well as others but HttpClient is the newest, for submitting HTTP requests. The following tutorial is about calling Web API but it will work for Web Forms too as it is just an HTTP request. Of course, you need to understand standard
HTML Web Form POST formatting.
The Windows OS has a scheduler that can run code at a configurable frequency. SQL server has an Agent that does the same. Plus there are many 3rd party schedulers.
Web Forms return HTML to the browser. I assume this new client is not a browser therefore the client application must understand HTML or have the ability to convert HTML to another format. This is research that you'll need to do as we cannot see your code.
Dec 28, 2017 04:04 PM|Diana4|LINK
Hello, Thanks for the great answer. i have a followup question. Is there a program I can write, using which i can copy the web generated charts and tables to powerpoint slides, after sizing them appropriately. Any article or tutorial, on how best to do that,
will be very helpful.
Dec 28, 2017 05:43 PM|mgebhard|LINK
Is there a program I can write, using which i can copy the web generated charts and tables to powerpoint slides, after sizing them appropriately. Any article or tutorial, on how best to do that, will be very helpful.
Using the requirement that the Web Forms pages do not change and given the result of a Web Form request is HTML, then the proposed application must convert HTML to a PPT file format. This question is probably better suited for PowerPoint support than ASP.NET.
Or maybe find a 3rd party tool that can handle the conversion.
I think it is important to realize that web pages are HTML because web sites are browser based application and browsers present information using HTML. If you are not planning to use a browser then HTML becomes less important. If you think about it, a
chart is nothing more that data points. IMHO, all you really need is the raw data. The same idea applies to tabular data. If you have the raw data then you should be able to convert the raw data to whatever format you like.
I would look into building services that expose the raw data rather than using the existing web pages.
Then I would look into solutions that can convert the raw data into the required file format.