Page 1 of 1

TRVItemList object range is 0..0

Posted: Fri Jan 12, 2024 11:24 pm
by Ceprotec
My reports are generated in a hidden form (the Show method is never called).

Most reports work well. However, some have exceptions when calling the Format method.

CallStack:

Code: Select all

System.Classes                          TList.Get
CRVData                      11601   +1 TCustomRVData.GetItem
CRVData                       5344   +1 TCustomRVData.IsFromNewLine
CRVFData                     14042   +1 TCustomRVFormattedData.IsFromNewLineEx
CRVFData                     13338   +1 TCustomRVFormattedData.IsDrawItemLastOnWrappedLine
RVERVData                     4456  +13 BuildCaretPositionsForDrawItem
RVERVData                     4546  +27 TRVEditRVData.OnChangeCaretLine
RVERVData                     6755   +9 TRVEditRVData.PrepareForEdit
RVERVData                     8087   +1 TRVEditRVData.GetCurItemNo
RVEdit                        2316   +0 TCustomRichViewEdit.GetCurItemNo
SclRView                     21251   +6 TSRichViewEdit.GetRVCaretRect
SclRView                     17939  +11 TSRichViewEdit.CalculateCaretPos
SclRView                     16643  +19 TSRichViewEdit.UpdatePosition
SclRView                      7549  +75 TSRVViewProperty.SetZoomPercent
SclRView                     13954  +10 TSRichViewEdit.UpdateView
SclRView                     19645 +128 TSRichViewEdit.SetMarginUnit
SclRView                     18723  +18 TSRichViewEdit.SetRVMargins
SclRView                     19323   +7 TSRichViewEdit.Format
UReportGeneratorForm        3083  +27 TReportGeneratorForm.ActionGenerateReportExecute

Code: Select all

GenerateReport ( srveResult , RVReportGenerator1 ) ;
srveResult.Format; // exception here

Code: Select all

exception number   : 1
exception class    : EListError
exception message  : List index out of bounds (1). TRVItemList object range is 0..0.
Any tips?

I will send the report template to your email.

Re: TRVItemList object range is 0..0

Posted: Mon Jan 15, 2024 2:23 pm
by Sergey Tkachenko
Answered by email

Re: TRVItemList object range is 0..0

Posted: Mon Jan 15, 2024 6:42 pm
by Ceprotec
Answered by email :D

Re: TRVItemList object range is 0..0

Posted: Sat May 04, 2024 9:59 pm
by Sergey Tkachenko
Summary: there really was a bug in ScaleRichView, if it was cleared by DeleteItems (not by Clear) and then formatted without adding a new content.
It may happen when ReportWorkshop generated an empty report in ScaleRichView (because a root data query returned 0 records).
This problem was fixed in the new version.