Creating spread table is not the same

Posted by: dror_farhi on 13 August 2018, 12:27 pm EST

  • Posted 13 August 2018, 12:27 pm EST

    Hi,
    I have an active x control that I am using on vb6:
    We currently updated this control from vaSpread version: 2.5.0.1, to the new fpSpread version 8.0.28.
    One of tables isn't created the same as it was created in the older version.
    The code for creating the table (We didn't change the code after upgrading to the new control):

    Private Sub BuildSuppRepTable()
    Dim Temptxt As String
    SprdSuppRepUnits.VisibleCols = 5
    SprdSuppRepUnits.VisibleRows = 5
    SprdSuppRepUnits.AutoSize = True
    SprdSuppRepUnits.SelectBlockOptions = 0
    SprdSuppRepUnits.ColWidth(0) = 4
    SprdSuppRepUnits.ColWidth(1) = 15
    SprdSuppRepUnits.ColWidth(2) = 0
    If CreatinineFlag Then
    SprdSuppRepUnits.ColWidth(3) = 15
    SprdSuppRepUnits.ColWidth(4) = 15
    Else
    SprdSuppRepUnits.ColWidth(3) = 0
    SprdSuppRepUnits.ColWidth(4) = 0
    End If
    SprdSuppRepUnits.ColWidth(5) = 15
    ' SprdSuppRepUnits.ColWidth(6) = 0
    SprdSuppRepUnits.RowHeight(0) = 25
    SprdSuppRepUnits.RowHeight(-1) = 15
    'Define Column headers
    SprdSuppRepUnits.Col = 0
    SprdSuppRepUnits.Row = 0
    SprdSuppRepUnits.Text = "#"
    SprdSuppRepUnits.Col = 1
    SprdSuppRepUnits.Row = 0
    SprdSuppRepUnits.Text = "Concentration Units"
    SprdSuppRepUnits.Col = 3
    SprdSuppRepUnits.Text = "Creatnine Concentration Units"
    SprdSuppRepUnits.Col = 4
    SprdSuppRepUnits.Text = "Creatnine Reportiong Units"
    SprdSuppRepUnits.Col = 5
    SprdSuppRepUnits.Text = Protein Units
    SprdSuppRepUnits.Col = -1
    SprdSuppRepUnits.Row = -1
    SprdSuppRepUnits.Lock = True
    Temptxt = % %/day µg µg/g ng ng/day µg µg/g %Hb/dL
    'clip entire Supported Reporting Units List
    SprdSuppRepUnits.Col = 1
    SprdSuppRepUnits.Row = 1
    SprdSuppRepUnits.Col2 = 5
    SprdSuppRepUnits.Row2 = 10
    If ClipString <> "" Then
    MySpread.Clip = Temptxt
    'count text-filled lines in spreadsheet
    TotalSuppRepUnits = CalcSpreadSheetLines(SprdSuppRepUnits)
    'save the initial number of lines sent
    'InitialNoOfLines = TotalSuppRepUnits
    End Sub

    Private Function CalcSpreadSheetLines(MySpread As FPSpreadADO.fpSpread) As Integer
    Dim i As Integer
    For i = 1 To MySpread.MaxRows
    MySpread.Col = 1
    MySpread.Row = i
    If StrComp(MySpread.Text, "") = 0 Then
    Exit For
    End If

    Next i
    CalcSpreadSheetLines = i - 1
    End Function

    I attached 2 screenshots that shows how it looks in the old version, and how it looks in the new version.

    What should I fix in order that the new version will look and behave like the old one ?

    Thanks,
    Dror Farhi
  • Replied 13 August 2018, 12:29 pm EST

    Hi,
    Just to explain my previous post:
    The table with column F is the new control. I don't know where it comes from.

    Thanks,
    Dror Farhi
  • Replied 14 August 2018, 5:41 am EST

    Hello,

    To solve this, you may set the maximum column count for your Spread control. For example:
    you can use :
    SprdSuppRepUnits.MaxCols= 5

    Thanks,
    Deepak Sharma
  • Replied 14 August 2018, 5:42 am EST

    Hi,
    I found the problem:
    In the old control, the property VisibleCols was referring to all columns.
    In the new control, the property VisibleCols is only referring to the visible columns.

    Thanks anyway,

    Dror Farhi
  • Marked as Answer

    Replied 14 August 2018, 5:45 am EST

    The visible columns are the columns that ColWidth > 0
    In the old control, it's all the columns including the columns that: ColWidth = 0
  • Replied 16 August 2018, 9:02 am EST

    Thanks for sharing the same.

    Regards,
    Deepak Sharma
Need extra support?

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

Learn More

Forum Channels