Registriert seit: 19. Mai 2006
17 Beiträge
|
Rave Customconnection Report wird generiert aber kein Inhalt
19. Sep 2008, 10:34
Datenbank: Firebird • Version: 1.5 • Zugriff über: bei diesem Problem nicht direct
Hilfe! Wer weiß was ich falsch mache?
Ich habe eine Reihe von Daten die irgendwie, das ist nicht wichtig, generiert und dann in einen Report geschrieben werden sollen. Daher verwende ich (hoffentlich!) ein Customconnection.
Ich habe die Felder mit
Delphi-Quellcode:
procedure TReportGen.RvCustomConnection1GetCols(Connection: TRvCustomConnection);
begin
with Connection do begin
WriteField('DateTime' , dtDateTime , 10, '', '');
WriteField('Addresse' , dtString , 90, '', '');
WriteField('Sensors' , dtString ,150, '', '');
WriteField('Event' , dtString , 60, '', '');
WriteField('ACNAME' , dtString , 16, '', '');
WriteField('ACFIRM' , dtString , 40, '', '');
WriteField('ACSUPERVISOR' , dtString , 50, '', '');
WriteField('ACADDRES' , dtString , 50, '', '');
WriteField('ACZIP' , dtString , 10, '', '');
WriteField('ACPLACE' , dtString , 50, '', '');
WriteField('ACSTATE' , dtString , 25, '', '');
WriteField('RECORDER' , dtString , 8, '', '');
WriteField('VEHICLE' , dtString , 16, '', '');
WriteField('DEVICE' , dtInteger , 10, '', '');
end;
end;
declariert und auch im Designer geladen.
Auf getRow wird das ganz dann mit
Delphi-Quellcode:
procedure TReportGen.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
var
Culture:TCulture;
AddressString,
EventString,
SensorString: String;
EventType : Integer;
aDuration,
aDateTime : TDateTime;
i : Integer; //Loops
begin
Culture.Code:=actualCommand.LanguageCode;
Culture.SpeedUnit:=kmh;
Culture.TempUnit:=Celsius;
CorF:='C';
if actualCommand.useMiles then
Culture.SpeedUnit:=mph;
if actualCommand.useFahrenheit then begin
Culture.TempUnit:=Fahrenheit;
CorF:='F';
end;
with FGeoCoderReportList.Items[Connection.DataIndex] as TGeoCoderEvent do begin
EventType:=Event;
aDateTime:=DateTimeON;
end;
case EventType of
cEVTJStart:with FGeoCoderReportList.Items[Connection.DataIndex] as TJourneyBegin do begin
AddressString:=Position.Address;
EventString:='Journey Start';
SensorString:='Sensors:';
end;
cEVTJStop: with FGeoCoderReportList.Items[Connection.DataIndex] as TJourneyEnd do begin
AddressString:=Position.Address;
EventString:='Journey Stop';
SensorString:='Sensors:';
end;
cEVTStop: with FGeoCoderReportList.Items[Connection.DataIndex] as TStopEvent do begin
AddressString:=Address;
EventString:='Stopped for '+ DateTimeToStr(Duration) + 'until'+DateTimeToStr(DatetimeOFF);
SensorString:=' '
end;
cEVTDoor: with FGeoCoderReportList.Items[Connection.DataIndex] as TDoorEvent do begin
EventString:='Door Opened for '+ DateTimeToStr(Duration) + 'until'+DateTimeToStr(DatetimeOFF);
SensorString:='Sensors:';
AddressString:=' ';
end;
cEVTAlarm: with FGeoCoderReportList.Items[Connection.DataIndex] as TAlarmEvent do begin
EventString:='Temp Alarm for'+ DateTimeToStr(Duration) + 'until'+DateTimeToStr(DatetimeOFF);
SensorString:='Sensors:';
AddressString:=' ';
end;
end;
WriteDateTime(aDateTime);
WriteStr(AddressString);
WriteStr(SensorString);
WriteStr(EventString);
WriteStr(IBQActuals.FieldByName('ACFIRM').AsString);
WriteStr(IBQActuals.FieldByName('ACSUPERVISOR').AsString);
WriteStr(IBQActuals.FieldByName('ACADDRES').AsString);
WriteStr(IBQActuals.FieldByName('ACZIP').AsString);
WriteStr(IBQActuals.FieldByName('ACPLACE').AsString);
WriteStr(IBQActuals.FieldByName('ACSTATE').AsString);
WriteStr(IBQActuals.FieldByName('RECORDER').AsString);
WriteStr(IBQActuals.FieldByName('VEHICLE').AsString);
WriteInt(IBQActuals.FieldByName('DEVICE').AsInteger);
end;
gefüllt.
auf onOpen mit
Delphi-Quellcode:
procedure TReportGen.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
GeoCodeAnalyzer1.DBID:=actualCommand.VehicleId;
GeoCodeAnalyzer1.Account:=actualCommand.AccountId;
GeoCodeAnalyzer1.User:=actualCommand.UserId;
GeoCodeAnalyzer1.ReportBegin:=actualCommand.DateBegin;
GeoCodeAnalyzer1.ReportEnd:=actualCommand.DateEnd;
FGeoCoderReportList:=GeoCodeAnalyzer1.geoGoderReport;
Connection.ClearBuffer;
Connection.DataRows := FGeoCoderReportList.Count;
Connection.DataIndex:=0;
end;
alles ordentlich (so glaube ich) instanziert.
Ich habe das was auf dem GeoCodeAnalyzer1 kommt geprüft und das ist auch OK. nur wird es nicht anständig in den Report geschrieben.
Wer weiß da einen guten Rat
Mit Dank im Vorraus
Bernd
|