Aspose.Cells changing paperbin

Last post 09-22-2011, 2:34 AM by mshakeel.faiz. 14 replies.
Sort Posts: Previous Next
  •  03-28-2011, 7:43 AM 293308

    Aspose.Cells changing paperbin .NET

    i'm still using an old version of aspose.cells. And i was wondering if in the new version you can print and change the tray (paperbin) of the printer without the need of using excel?

    Filed under: Apose.Cells
     
  •  03-28-2011, 8:11 AM 293312 in reply to 293308

    Re: Aspose.Cells changing paperbin

    Hi,

    Please check the document:
    http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/printing-workbooks.html

    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-29-2011, 2:05 AM 293497 in reply to 293312

    Re: Aspose.Cells changing paperbin

    I see you can print now, but can you change the tray of the printer also?
     
  •  03-29-2011, 2:38 AM 293500 in reply to 293497

    Re: Aspose.Cells changing paperbin

    Hi,

    Do you need to customize the paper size, if so, you may use PageSeup API provided by Aspose.Cells before taking the print of the sheets.

    Check the documents for your reference
    http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-page-options.html
    http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-margins.html


    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-29-2011, 2:47 AM 293501 in reply to 293500

    Re: Aspose.Cells changing paperbin

    no, we must be able to print the same document on 4 different paper colors. So first it must be printed on the paper on tray one (paperbin 1) then on the paper in the second tray etc... Se we must be able to change the paperbin.
     
  •  03-29-2011, 2:59 AM 293504 in reply to 293501

    Re: Aspose.Cells changing paperbin

    Hi,

    I think, you are looking for SheetRender.ToPrinter() function. You can use this function to send your output to the printer of your choice.

    Here is a code example.

    C#
    Aspose.Cells.Rendering.ImageOrPrintOptions iopo = new Aspose.Cells.Rendering.ImageOrPrintOptions();
    Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(worksheet, iopo);
    sr.ToPrinter(printerName);


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  03-29-2011, 3:10 AM 293509 in reply to 293504

    Re: Aspose.Cells changing paperbin

    the printer is the same, but it has to print on the paper of another paper tray in that printer
     
  •  03-29-2011, 3:18 AM 293510 in reply to 293509

    Re: Aspose.Cells changing paperbin

    Hi,

    Thanks for your posting.

    We will support custom paper source in next fix version . Hopefully 2~3 days.

    This issue has been logged as CELLSNET-25634.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  03-29-2011, 3:35 AM 293515 in reply to 293510

    Re: Aspose.Cells changing paperbin

    Thanks, i will check again in a week
     
  •  03-30-2011, 4:56 AM 293840 in reply to 293515

    Re: Aspose.Cells changing paperbin

    Attachment: Present (inaccessible)
    Hi, 

    Please try this fix Aspose.Cells for .NET v5.3.1.5.

    We have written a Demo (please download the attached Test.cs.txt) that shows how to the change Printer Paper Bin when print each page
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  09-14-2011, 9:02 AM 329333 in reply to 293840

    Re: Aspose.Cells changing paperbin

    Meanwhile we have upgraded to the latest version of aspose (7.0.1). but still we have trouble to print to the chosen paperbin.

    It seems that the sheetrenderer doesn’t know that we have changed the papersource. When we debug the code the ev.PageSettings.PaperSource is set correctly, but still the printer prints from tray 1.

    below our code:

    (The "MyPrinter" and tray RawKind 7 we select from the list we receive from the InstalledPrinters and Papersources.)
     

       Dim _PrintDocument As New PrintDocument
        Dim _Renderer As SheetRender

        Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

            Dim _Workbook As New Workbook("c:\fits\test.xlsx")

            Dim _Options As New ImageOrPrintOptions

            _PrintDocument.PrinterSettings.PrinterName = lstPrinters.SelectedItem


            Dim pe As New PrintPageEventHandler(AddressOf PrintPage)

            _Options.CustomPrintPageEventHandler = pe

            _Renderer = New SheetRender(_Workbook.Worksheets(0), _Options)

            _Renderer.ToPrinter("MyPrinter")

        End Sub

        Public Sub PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)

            For Each _PaperSource As PaperSource In _PrintDocument.PrinterSettings.PaperSources

                If _PaperSource.RawKind = 7 Then

                    ev.PageSettings.PaperSource = _PaperSource

                End If

            Next

        End Sub


    Is there a solution?
     
  •  09-15-2011, 4:55 AM 329548 in reply to 329333

    Re: Aspose.Cells changing paperbin

    Hi,

    You must call sr.CustomPrint in PrintPage just like an example in previous post.

    C#
    for (int i = 0; i < pd.PrinterSettings.PaperSources.Count; i++) {
             //set PaperSouce for current page
             ev.PageSettings.PaperSource = pd.PrinterSettings.PaperSources[i];
             currentIndex = sr.CustomPrint(i == pd.PrinterSettings.PaperSources.Count - 1, ev);
    }

    will print same page in every paper source, if you just want to print certain source, then you should pass same paper source to ev.PageSettings.PaperSource.
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  09-21-2011, 3:18 AM 330857 in reply to 329548

    Re: Aspose.Cells changing paperbin

    Hi

    we have changed our code as follows:

    Public Sub PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)

            ev.PageSettings.PaperSource = (From _PS As PaperSource In _PrintDocument.PrinterSettings.PaperSources Where _PS.RawKind = 4)(0)

            _Renderer.CustomPrint(False, ev)

            ev.HasMorePages = False

        End Sub

    In our case the worksheet count 1 page that needs to be printed out from bypass tray with id 4.
    The code above still prints the document from tray 1.
     
  •  09-22-2011, 1:46 AM 331108 in reply to 330857

    Re: Aspose.Cells changing paperbin

    Hi,

    Thanks for your comment/feedback. We have added it in our database.Once we will get any update, we will let you know.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  09-22-2011, 2:34 AM 331116 in reply to 330857

    Re: Aspose.Cells changing paperbin

    Hi,

    We noticed that .NET framework does not fully support certain printer.

    You can check it by writing a sample code to draw something and print to certain paper bin. If you can change the paper source, then please provide us your demo project.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML