GetChildView with many rows

Posted by: patrik on 23 July 2019, 4:10 am EST

    • Post Options:
    • Link

    Posted 23 July 2019, 4:10 am EST

    My databas have about 1000 line in first level. but in levels under I have about 50 000 rows.

    When I run the the code below it’s take about 10 minut.

    Is there some other way to do this that will not take so long time?

     For i = 0 To FpSpread1.ActiveSheet.RowCount - 1
                If FpSpread1.ActiveSheet.GetChildView(i, 0).RowCount = 0 Then FpSpread1.ActiveSheet.SetRowExpandable(i, False)
            Next
    
  • Posted 24 July 2019, 7:52 am EST

    Hello Patrik,

    Sorry, but there is no alternative to it. To check which all rows have child rows/not, one needs to traverse the rows collection of the sheet.

    Kind Regards,

    Ruchir

  • Posted 24 July 2019, 8:37 am EST

    If I understand everything right it’s take this time because it’s have to count all records under. You don’t think it’s will be possible to have a check that only check first record under and then return true or false and not how many record under. I think this will take away 95% of the time of count.

    For the moment this is functions only work in small project.

  • Posted 25 July 2019, 9:48 am EST

    Hello,

    Using GetChildView for the parent row does not actually traverse the child rows wherein we can break just at first one, it creates sheet for children. And since this needs to happen for every parent row, performance degrades. I could not find a solution to optimize it.

    ~Ruchir

Need extra support?

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

Learn More

Forum Channels