Click here to Skip to main content
15,897,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...
I have a situation as follows:
My company has its Customers Data stored in a server, and we as employees use Internet Explorer to find the data needed through a page that contains some textboxes to supply info to the server and some other textboxes that shows Data retrieved from server. So fro example I put the customerID in a textbox, press the search button near this textbox, and I get the customerName and customerAge and so on in another textboxes in the same webpage. I konw this is done via JavaScripts.

I hope the scene is clear, Now when I need to print a report about certain customer I have to copy/paste every single textbox content to Word individually.

So I know how to export from C# to Word or at least to Excel .., But is it possible to make a C# WinForms App that can read the contents of these textboxes OR call the JS function that is executed when I press the (Search) button shown in the IE WebPage.

I dont know if my question is clear enough but I hope you can help me. Any help would be appreciated.
Thanks in advance
Posted

1 solution

Hello,

To start with, I guess if you read the basics of web programming that might be useful. Ideally the web page displays customer data through one of these methods to start with (these are not only ways - these are the ones normally used):

* Assuming the web page uses ASP.Net, through the web forms model
* Or using web services.

In most cases it would be the web forms model. If there is a corresponding web service that could also be used to display the same information. By referring to "through javascript" I guess you mean web services. Because javascript by itself cannot do that.

So, if there is a web service that provides this information you could "consume" that web service to get the information you require. Else if you have the connection information to the database server that houses this information you could use that too. So, I advice you to grab a C# windows forms programming book and get to know the basics. Also a book about ASP.Net could help you understand the web model.
 
Share this answer
 
Comments
Roberta Mafessoni 17-Oct-10 12:37pm    
Hello Karthok,
Thanks for your contribution even though it confused me more and more. I am already aware that this is a web service and I know what Java Scripts are, but the problem is that I dont know he to interact with these JSs from my WinForms App,IF such thing is doable at all.
Anyways, thank you again and I hope to hear from you even again
Karthik. A 17-Oct-10 14:24pm    
Roberto, if there is a web service then you need not worry about javascript. You can add a web reference to your windows application project and consume the web service. This link might help- http://msdn.microsoft.com/en-us/library/scf355x6(VS.80).aspx. This is pretty basic, but will help you get started. And sorry for confusing you!
Karthik. A 17-Oct-10 14:26pm    
A blog post about adding web references and more - http://www.codeproject.com/Messages/3613330/Re-how-to-get-add-web-reference-option-in-windowsa.aspx
Roberta Mafessoni 17-Oct-10 14:52pm    
Hi Karthik. A... Thanks for your fast response. I am going to check the links provided and see what pops out, BUT.....
It is Roberta (a girl) not Roberto (the other thing :) ) and this is clearly stated in the picture of my profile here in codeproject.
Again, thanks a lot.
Karthik. A 17-Oct-10 20:48pm    
Oops! I am sorry, didn't see your profile! In case you have more questions, post it here, will try not to confuse you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900