columnspan and printing

Posted by: franz on 8 September 2017, 2:07 pm EST

  • Posted 8 September 2017, 2:07 pm EST

    Hello,


    How can I achieve that cells that have a columnspan of let's say 3 are kept together while printing.
    Is there a way to detect what column would be the last one while printing with the printinfo object on that moment?


    Thanks in advance,


    Frank

  • Replied 8 September 2017, 2:07 pm EST

    Hello,

    I am able to print the spanned cells with no issuesI used the following code to do so please have a look,

    I have also attached the print preview image for the same.I am using Spread for Windows Forms version 4.0.2012.2005.

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            FpSpread1.ActiveSheet.Cells(0, 0).Text = "These six cells are spanned."
            FpSpread1.ActiveSheet.AddSpanCell(0, 0, 8, 3)
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim pi As New FarPoint.Win.Spread.PrintInfo
            pi.PrintType = FarPoint.Win.Spread.PrintType.All
            pi.Preview = True
            FpSpread1.ActiveSheet.PrintInfo = pi
            FpSpread1.PrintSheet(0)
        End Sub

    PrintInfo object's "ColEnd" property can be used to get the last column to print when a cell range is being printed.

    Thanks,

     


    2009/11/PrintPreviewforSpannedCells.JPG
  • Replied 8 September 2017, 2:07 pm EST

    Hello,


    Thanks for the reply,
    the problem arises when I'm printing a sheet consisting out of 2 pages,
    where I have at the end of page one 3 spanned cells.


    Now I want those 3 cells to be printed together, so if the spread can't print them all on page one,
    the 3 off them have to be printed on page two, so on page one there would be a blanc area at the end.


    I have attached a printscreen that demonstrates the problem.


    I'm using Spread for Windows Forms version 4.0.2010.2005.


    Thanks in advance,


    Frank


    2009/11/farpoint1.JPG
  • Replied 8 September 2017, 2:07 pm EST

    Hello,

    I am able to get the spanned cell printed properly at every position on the page using the same above code.

    Could you please post a small zipped sample application for us to debug.

    Thanks,

     

  • Replied 8 September 2017, 2:07 pm EST

    Hi,


    So i attached a small project which clarifies itself.


    Thanks,


    Frank


    2009/11/FarPointSpannedCellsPrint.zip
  • Replied 8 September 2017, 2:07 pm EST

    Hello,

    Setting  UseSmartPrint to True might help you to optimize the printing using Rules.

    I made a slight change in your project , it is working fine now.Let me know if you need further assistance.

    Thanks,

     

     


    2009/11/FarPointSpannedCellsPrint.rar
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels