BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with RvCustomConnection and BDS 2006

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Thirdparty Tools (RaveReports)
View previous topic :: View next topic  
Author Message
Vincent
Guest





PostPosted: Tue Nov 14, 2006 1:23 am    Post subject: Help with RvCustomConnection and BDS 2006 Reply with quote



I am obviously missing somthing here but I can not get Rave to report
anything.

I created a simple test program to see if I can figure this out.

First I created a simple data structure to hold the data I wanted reported
on:

TPrinterReportRec = Record
ToName : string;
FromName : String;
TradeID : String;
TransCount : Integer;
Rate : Real;
NetTrans : Integer;
end;
TPrinterReportList = Array of TPrinterReportRec;

I created the needed functions to populate that with some data. Then I added
a "RvCustomConnection" vai the Borland IDE to my poject. I also added a
RvSystem and a RvProject. Then I created the OnEOF,
First,GetCols,GetRow,Next,Open, Restore procedures and linked them to the
RvCustomConnection as per the docs I found at
http://www.nevrona.com/files/ravedevguide5.pdf

Here is GetCols and GetRow:

//*******************************************************************
Procedure TPrinterDataModule.RvCustomConnection1GetCols(
Connection: TRvCustomConnection);
Begin
with Connection do begin
WriteField('ToName', dtString, 255, 'ToName', 'ToName');
WriteField('FromName', dtString, 255, 'FromName', 'FromName');
WriteField('TradeID', dtString, 255, 'TradeID', 'TradeID');
WriteField('TranCount', dtInteger, 11, 'TranCount', 'TranCount');
WriteField('Rate', dtFloat, 11, 'Rate', 'Rater');
WriteField('NetCount', dtInteger, 11, 'NetCoun', 'NetCoun');
end; //with
End;

//*******************************************************************
Procedure TPrinterDataModule.RvCustomConnection1GetRow(
Connection: TRvCustomConnection);
begin
with Connection do begin
WriteStrData(ReportTable[CurRecord].ToName,ReportTable[CurRecord].ToName);
WriteStrData(ReportTable[CurRecord].FromName,ReportTable[CurRecord].FromName);
WriteStrData(ReportTable[CurRecord].TradeID,ReportTable[CurRecord].TradeID);
WriteIntData('',ReportTable[CurRecord].TransCount);
WriteFloatData('',ReportTable[CurRecord].Rate);
WriteIntData('',ReportTable[CurRecord].NetTrans);
end; //with
end;


Using the Rave interface I created a simple report, and added a Dataview
that was linked to my RvCustomConnection. I then created a Databand and
linked it to the Dataview, and added a DataText component which I set to the
Dataview with a DataField of "ToName". Back in my code I call the Rave
report like this...

RvProject.Open;
RvProject.SelectReport('SimpleReport',False);
RvProject.Execute;
RvProject.Close;

When I run it, it brings up a window that lets me choose between
Print/Preview/etc. I pick Preview and I get the preview screen, but the
report is completely blank.

I also do not get a field listing in Rave after following the directions in
this documentation :
http://www.nevrona.com/Default.aspx?tabid=67

When I trace it, GetCol, Next, and EOF are all called, but GetRow is never
called.

Any idea what I am missing here? Rave version 6.5 with BDS 2006.

Thanks!
Vincent
Back to top
Vincent
Guest





PostPosted: Wed Nov 15, 2006 10:25 pm    Post subject: Re: Help with RvCustomConnection and BDS 2006 Reply with quote



Never mind, found the error. Simple typo in the EOF function:

I had
Result := CurRecord <= Length(TheData);
instead of
Result := CurRecord >= Length(TheData);

ops :)

Works fine now.

"Vincent" <vydorian (AT) gmail (DOT) com> wrote in message
news:4558c641$1 (AT) newsgroups (DOT) borland.com...
Quote:
I am obviously missing somthing here but I can not get Rave to report
anything.

I created a simple test program to see if I can figure this out.

First I created a simple data structure to hold the data I wanted reported
on:

TPrinterReportRec = Record
ToName : string;
FromName : String;
TradeID : String;
TransCount : Integer;
Rate : Real;
NetTrans : Integer;
end;
TPrinterReportList = Array of TPrinterReportRec;

I created the needed functions to populate that with some data. Then I
added a "RvCustomConnection" vai the Borland IDE to my poject. I also
added a RvSystem and a RvProject. Then I created the OnEOF,
First,GetCols,GetRow,Next,Open, Restore procedures and linked them to the
RvCustomConnection as per the docs I found at
http://www.nevrona.com/files/ravedevguide5.pdf

Here is GetCols and GetRow:

//*******************************************************************
Procedure TPrinterDataModule.RvCustomConnection1GetCols(
Connection: TRvCustomConnection);
Begin
with Connection do begin
WriteField('ToName', dtString, 255, 'ToName', 'ToName');
WriteField('FromName', dtString, 255, 'FromName', 'FromName');
WriteField('TradeID', dtString, 255, 'TradeID', 'TradeID');
WriteField('TranCount', dtInteger, 11, 'TranCount', 'TranCount');
WriteField('Rate', dtFloat, 11, 'Rate', 'Rater');
WriteField('NetCount', dtInteger, 11, 'NetCoun', 'NetCoun');
end; //with
End;

//*******************************************************************
Procedure TPrinterDataModule.RvCustomConnection1GetRow(
Connection: TRvCustomConnection);
begin
with Connection do begin

WriteStrData(ReportTable[CurRecord].ToName,ReportTable[CurRecord].ToName);

WriteStrData(ReportTable[CurRecord].FromName,ReportTable[CurRecord].FromName);

WriteStrData(ReportTable[CurRecord].TradeID,ReportTable[CurRecord].TradeID);
WriteIntData('',ReportTable[CurRecord].TransCount);
WriteFloatData('',ReportTable[CurRecord].Rate);
WriteIntData('',ReportTable[CurRecord].NetTrans);
end; //with
end;


Using the Rave interface I created a simple report, and added a Dataview
that was linked to my RvCustomConnection. I then created a Databand and
linked it to the Dataview, and added a DataText component which I set to
the Dataview with a DataField of "ToName". Back in my code I call the
Rave report like this...

RvProject.Open;
RvProject.SelectReport('SimpleReport',False);
RvProject.Execute;
RvProject.Close;

When I run it, it brings up a window that lets me choose between
Print/Preview/etc. I pick Preview and I get the preview screen, but the
report is completely blank.

I also do not get a field listing in Rave after following the directions
in this documentation :
http://www.nevrona.com/Default.aspx?tabid=67

When I trace it, GetCol, Next, and EOF are all called, but GetRow is never
called.

Any idea what I am missing here? Rave version 6.5 with BDS 2006.

Thanks!
Vincent


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Thirdparty Tools (RaveReports) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.