printing local excel file with ASP.Net
-
Hello everyone, I have an excel file in the same directory as my .aspx page and I need it to printed to the user's default printer (after whatever necessary dialogs) when a button is clicked. All the tutorials I've found are windows forms examples are pretty clunky and I'm not quite sure how to transfer them over the to context of web forms. If anyone could give me any pointers or links to examples, I would be most appreciative. Thanks in advance! ------------------- abort, retry, fail?
-
Hello everyone, I have an excel file in the same directory as my .aspx page and I need it to printed to the user's default printer (after whatever necessary dialogs) when a button is clicked. All the tutorials I've found are windows forms examples are pretty clunky and I'm not quite sure how to transfer them over the to context of web forms. If anyone could give me any pointers or links to examples, I would be most appreciative. Thanks in advance! ------------------- abort, retry, fail?
-
you could maybe download the file and using Page.RegisterStartUpScript() send javascript code "window.print();" Nick 1 line of code equals many bugs. So don't write any!!
That gave me an awesome idea that worked out great. In case anyone's interested, here's what I did: 1. saved my query string as a session variable 2. added an attribute to my link button that triggered the print to open a new window 3. opened a new window that containted print.aspx on click, that did the follwing: - populated a datagrid from the query string session variable - registered a client script that: - called window.print() - called window.close() Thanks for your help! ------------------- abort, retry, fail?