Click here to Skip to main content
15,905,563 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with Collections Pin
crushinghellhammer22-Jan-04 20:25
crushinghellhammer22-Jan-04 20:25 
GeneralRe: Help with Collections Pin
crushinghellhammer23-Jan-04 7:36
crushinghellhammer23-Jan-04 7:36 
GeneralRe: Help with Collections Pin
Heath Stewart23-Jan-04 8:21
protectorHeath Stewart23-Jan-04 8:21 
GeneralRe: Help with Collections Pin
crushinghellhammer23-Jan-04 7:44
crushinghellhammer23-Jan-04 7:44 
Questionhow to embed excel and pdf into winform ? Pin
Xpeive22-Jan-04 16:14
Xpeive22-Jan-04 16:14 
AnswerRe: how to embed excel and pdf into winform ? Pin
Heath Stewart22-Jan-04 18:42
protectorHeath Stewart22-Jan-04 18:42 
GeneralRe: how to embed excel and pdf into winform ? Pin
Xpeive23-Jan-04 16:34
Xpeive23-Jan-04 16:34 
GeneralRe: how to embed excel and pdf into winform ? Pin
Heath Stewart23-Jan-04 17:52
protectorHeath Stewart23-Jan-04 17:52 
You actually don't need to embed the Excel control to do this: there's two very simple ways of doing. The easiest is to do something like this:
ProcessStartInfo psi = new ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = "C:\path\to\spreadsheet.xls";
psi.Verb = "print";
Process.Start(psi);
You can further hide the application window by setting psi.WindowStyle = ProcessWindowStyle.Hidden.

You can also reference the Microsoft.Office.Excel primary interop assembly (you can generate them yourself, but it's better to use the official ones from http://msdn.microsoft.com/library/en-us/dnoxpta/html/odc_oxppias.asp[^]) and print the spreadsheet. This uses an out-of-process automation server (Excel.Application) to load and print the document:
Microsoft.Office.Interop.Excel.Application excel =
  new ApplicationClass();
Workbook wb = excel.Workbooks.Open(this.filename, 0, false, 5,
  "", "", false, XlPlatform.xlWindows, "", true, false, 0, true,
  false, false);
 
object missing = Missing.Value;
wb.PrintOut(missing, missing, missing, missing, missing, missing,
  missing, missing);
 
excel.Quit();


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: how to embed excel and pdf into winform ? Pin
Xpeive23-Jan-04 22:59
Xpeive23-Jan-04 22:59 
AnswerRe: how to embed excel and pdf into winform ? Pin
Guillermo Rivero23-Jan-04 1:27
Guillermo Rivero23-Jan-04 1:27 
GeneralCustom Component Functions Pin
obelisk2922-Jan-04 14:47
obelisk2922-Jan-04 14:47 
GeneralRe: Custom Component Functions Pin
Heath Stewart22-Jan-04 18:33
protectorHeath Stewart22-Jan-04 18:33 
GeneralRe: Custom Component Functions Pin
David Stone22-Jan-04 19:24
sitebuilderDavid Stone22-Jan-04 19:24 
GeneralRe: Custom Component Functions Pin
Heath Stewart22-Jan-04 19:30
protectorHeath Stewart22-Jan-04 19:30 
GeneralWait Cursor Pin
Anders Molin22-Jan-04 11:49
professionalAnders Molin22-Jan-04 11:49 
GeneralRe: Wait Cursor Pin
Heath Stewart22-Jan-04 12:50
protectorHeath Stewart22-Jan-04 12:50 
GeneralRe: Wait Cursor Pin
Anders Molin22-Jan-04 13:01
professionalAnders Molin22-Jan-04 13:01 
GeneralRe: Wait Cursor Pin
Heath Stewart22-Jan-04 18:28
protectorHeath Stewart22-Jan-04 18:28 
GeneralRe: Wait Cursor Pin
Anders Molin22-Jan-04 20:54
professionalAnders Molin22-Jan-04 20:54 
GeneralRe: Wait Cursor Pin
Heath Stewart23-Jan-04 4:31
protectorHeath Stewart23-Jan-04 4:31 
GeneralRe: Wait Cursor Pin
Anders Molin23-Jan-04 5:33
professionalAnders Molin23-Jan-04 5:33 
GeneralRe: Wait Cursor Pin
Alvaro Mendez23-Jan-04 8:07
Alvaro Mendez23-Jan-04 8:07 
GeneralSigning an assembly with a strong name Pin
RadioButton22-Jan-04 10:34
RadioButton22-Jan-04 10:34 
GeneralRe: Signing an assembly with a strong name Pin
Heath Stewart22-Jan-04 10:48
protectorHeath Stewart22-Jan-04 10:48 
GeneralRe: Signing an assembly with a strong name Pin
RadioButton22-Jan-04 10:57
RadioButton22-Jan-04 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.