Ok, habs rausgefunden:
Delphi-Quellcode:
procedure TIWUserSession.generatePDF(pdfName: String; ravName: String);
var
rvProject: TRvProject;
rvSystem: TRvSystem;
rvPDF: TRvRenderPDF;
rvCcOutputs: TRvCustomConnection;
dvOutputs: TRaveDataView;
dcOutputs: TRaveDataConnection;
rvPage: TRavePage;
bndOutputs: TRaveDataBand;
begin
// init components
rvProject := TRvProject.Create(self);
rvSystem := TRvSystem.Create(self);
rvCcOutputs := TRvCustomConnection.Create(self);
rvPDF := TRvRenderPDF.Create(self);
// apply event-hanlders to custom-connection
rvCcOutputs.OnEOF := rvCcOutputsEOF;
rvCcOutputs.OnFirst := rvCcOutputsFirst;
rvCcOutputs.OnGetCols := rvCcOutputsGetCols;
rvCcOutputs.OnGetRow := rvCcOutputsGetRow;
rvCcOutputs.OnNext := rvCcOutputsNext;
rvCcOutputs.OnOpen := rvCcOutputsOpen;
// modify custom connection
rvCcOutputs.DataIndex := 0;
rvCcOutputs.DataRows := outputSets.Count;
// modify system-properties
rvSystem.SystemOptions := rvSystem.SystemOptions - [soShowStatus];
rvSystem.SystemSetups := rvSystem.SystemSetups - [ssAllowSetup];
rvSystem.DefaultDest := rdFile;
rvSystem.DoNativeOutput := false;
rvSystem.RenderObject := rvPDF;
rvSystem.OutputFileName := pdfName;
// modify project
rvProject.Engine := rvSystem;
rvProject.ProjectFile := ravName;
rvProject.Open();
// build & modify data view for the report
dcOutputs := CreateDataCon(rvCcOutputs);
dvOutputs := rvProject.ProjMan.NewDataObject(TRaveDataView) as TRaveDataView;
dvOutputs.Name := 'dvOutputs';
dvOutputs.ConnectionName := dcOutputs.name;
dvOutputs.DataCon := dcOutputs;
CreateFields(dvOutputs, nil, nil, true);
// get data-band & apply data-view
rvPage := rvProject.ProjMan.FindRaveComponent('Report1.Page1', nil) as TRavePage;
bndOutputs := rvProject.ProjMan.FindRaveComponent('bndOutputs', rvPage) as TRaveDataBand;
bndOutputs.DataView := dvOutputs;
// execute report
rvProject.Execute();
// reset report & custom-connection
rvProject.Close();
rvCcOutputs.DataRows := 0;
rvCcOutputs.DataIndex := 0;
end;
Das behebt mein Problem aber leider immer noch nich. :-/
Das 1. Dokument is nach wie vor einwandfrei, beim 2. passiert gar nix mehr.