ColumnHeader wordwrap

Posted by: rick-macdonald on 8 September 2017, 1:57 pm EST

  • Posted 8 September 2017, 1:57 pm EST


    I am using Spread for Windows Forms 4.0.2010.2005 with VS2005 visual basic 


    ColumnHeaderLabel text has been set to 'FFT Power Spectra (PV=in/s)'


    the text always wraps the between  'FFT Power Spectra' and '(PV=in/s)' when printed


    but not on screen display.  On the printout the bottom half of  'FFT Power Spectra'  is visible


    and the upper half of '(PV=in/s)' is visible like there is multiple lines of text behind a single line viewing area 


    I have tried other text with different but still unexpected results 


    Thanks for your help


    Dim nCols As Integer


    Dim nRows As Integer


    Dim tmpTitle As String


    Dim tmpSubTitle As String


    Dim tmpUnit1 As String


    nCols = 4


    nRows = 10


    tmpTitle = "FFT Power Spectra (PV=in/s)"


    tmpSubTitle = "SN: 3000 Event: 8"


    tmpUnit1 = "PV^2/Hz"


    FpSpread1.Reset()


    FpSpread1.ActiveSheet.SetRowHeight(-1, 16) 'Default=20 pixels


    FpSpread1.ActiveSheet.Rows(-1).Resizable = False


    FpSpread1.AutoClipboard = True


    FpSpread1.AllowDragDrop = True


    FpSpread1.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both


    FpSpread1.ActiveSheet.OperationMode = FarPoint.Win.Spread.OperationMode.Normal


    FpSpread1.ActiveSheet.ColumnCount = nCols


    FpSpread1.ActiveSheet.RowCount = nRows


    FpSpread1.ActiveSheet.ColumnHeaderVisible = True


    FpSpread1.ActiveSheet.ColumnHeaderRowCount = 3


    FpSpread1.ActiveSheet.ColumnHeader.Rows(0).Height = 32


    FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(0, 0, 1, nCols)


    FpSpread1.ActiveSheet.AddColumnHeaderSpanCell(1, 0, 1, nCols)


    FpSpread1.ActiveSheet.SetColumnLabel(0, 0, tmpTitle)


    FpSpread1.ActiveSheet.SetColumnLabel(1, 0, tmpSubTitle)


    FpSpread1.ActiveSheet.ColumnHeader.Columns(0).Label = "(Hz)"


    FpSpread1.ActiveSheet.ColumnHeader.Columns(1).Label = "L (PV^2/Hz)"


    FpSpread1.ActiveSheet.ColumnHeader.Columns(2).Label = "T (PV^2/Hz)"


    FpSpread1.ActiveSheet.ColumnHeader.Columns(3).Label = "V (PV^2/Hz)"


    FpSpread1.ActiveSheet.Columns(0).Width = 60


    FpSpread1.ActiveSheet.Columns(1).Width = 100


    FpSpread1.ActiveSheet.Columns(2).Width = 100


    FpSpread1.ActiveSheet.Columns(3).Width = 100


    For i = 0 To nCols - 1


    FpSpread1.ActiveSheet.Columns(i).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center


    Next i


    FpSpread1.ActiveSheet.Columns(0, nCols - 1).AllowAutoSort = True


    'add some dummy data


    For i = 0 To nRows - 1


    FpSpread1.ActiveSheet.SetText(i, 0, i.ToString)


    FpSpread1.ActiveSheet.SetText(i, 1, i.ToString)


    FpSpread1.ActiveSheet.SetText(i, 2, i.ToString)


    FpSpread1.ActiveSheet.SetText(i, 3, i.ToString)


    Next i


    FpSpread1.Update()


    FpSpread1.PrintSheet(0)

  • Replied 8 September 2017, 1:57 pm EST

     


    The best option is to set BestFitCols to true and / or turn word wrap off on the headers.

Need extra support?

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

Learn More

Forum Channels