jcom print

2007-06-14
2013-04-17
  • Nobody/Anonymous

    i wanna know
    Can jcom only print the real file,like:

                ExcelApplication excel = new ExcelApplication(rm);
                ExcelWorkbooks xlBooks = excel.Workbooks();
                ExcelWorkbook xlBook = xlBooks.Open(fname);//fname="d://xxx.xsl"
                ExcelWorksheet xlSheet = excel.ActiveSheet();
                xlSheet.PrintOut();

    and have to create a file then print it or can print some object like OutputStream? so that i dont need to creat a file in the disk.

    Really thanks for ur help.

     
    • Nobody/Anonymous

      I believe it's possible ,

      in VBA it looks like this :
          Range("A1").Select
          ActiveCell.FormulaR1C1 = "a"
          Range("B1").Select
          ActiveCell.FormulaR1C1 = "b"
          Range("C1").Select
          ActiveCell.FormulaR1C1 = "c"
          Range("A2").Select
          ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

      your not forced to open ExcelWorkbook based on an existing file ,
      you can add workbook(s) when you have opened xlBooks

      greetings
      Krist

       
    • Nobody/Anonymous

      HI,Krist

      Really thanks for your reply.The problem is now I have a file stream,I want to print it out and dont want change it into a file in the disk.I know,u say we can creat the workbook.but the workbook base on the Class "IDispatch" too,and IDispatch have a navite method (access the COM component) to creat an instance of itself if you want put a file object into it:

      _invoke(dispid, METHOD, args);//args[0] = Filename;

      Now i just need the stream,otherwise I have to do the write file operation.That's the problem...:/ 

      Eitan :)

       

Log in to post a comment.