TfrxDBXQuery in the AddValue method

hi,

I'm a beginner to Fast-Reports and I'm trying to build a report that I use a "CrossTab Object".

I have a TfrxDBXQuery Called qryReport and I need to fill the CrossTab with the results of this query.

Before you guys start telling me to use a "DB-Cross Tab Oject" I will say that I have a special need to use a plain "CrossTab Object" for I'm treating the data as the report prints the cells.

I'm using the OnBeforePrint Event and this is what I'm doing:

while not qryReport.Eof do
begin
AddValue([DateToStr(qryReport.Fields[0].Value)], [qryReport.Fields[2].Value)], [qryReport.Fields[1].Value]);
qryReport.Next;
end;

At my query it returns datas from the Date, Value and Name fields which are being called with the qrytReports.Fields[POSITION].Value thing.

The problem is that I keep getting this exception:

"exception class EStringListError with message 'List out of bounds(3).'" from the
fr_iclassesrtti Unit.

I don't know exactly what I'm doing wrong, if you could help me with that I'd apreciated that a lot!!

Thanks again!!

Comments

  • edited 2:27PM
    Has Done so and all work.
    You certain that , in request there is all field
    procedure Cross1OnBeforePrint(Sender: TfrxComponent);
    begin
    ADOQuery1.First;
    while not ADOQuery1.Eof do
    begin
    Cross1.AddValue([ADOQuery1.Fields[0].Value], [ADOQuery1.Fields[3].Value], [ADOQuery1.Fields[5].Value]);
    ADOQuery1.Next;
    end;
    end;
    
    Can in query no several Fields?
  • edited 2:27PM
    Den,

    It was a problem in the way I was building another thing that was returning that exception, because there is no debuger in fast-reports I got kind of messed up with this thing and didn't quite know wether it was a mistake at the addValue Method or anywhere else.

    Thank you for the help you extend to me always!!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.