1
Rave Reports 10에 대한 경험이 있습니다. 이전에 많은 보고서를 작성했지만 지금은 생성 문제가 있습니다.Delphi Rave 보고서 빈 페이지 생성
검사 목록 : 기본 폼에 -RvProject -RvSystem -RvDataSet -RvRenderPDF
내가 성공적으로 을 보고서를 생성 할 수 있습니다 레이브 디자이너에
을 설정 그들 모두하지만 난 사용할 때 빈 페이지를 생성하는 코드.내 코드를 확인하고 뭔가 빠진 것이 있는지 알려줄 수 있습니까? 이 이틀 전부터이 가파른 곳에 갇힌 Im이이 문제를 해결할 수 없습니다.
나는 많은 변수가 있지만 사용하지 않고 몇 가지 것을 알고있다. 내가 마지막으로 오류를 발견
procedure TFormPrincipal.ImprimirReporteDeNomina(FechaCorte:String);
var
DireccionMisDocumentos,A:String;
Año, Mes, Dia:Word;
I:Integer;
MyFields: array of TField;
Temf: TStringField;
DataView: TRaveBaseDataView;
myPage:TRavePage;
MyDataText:TRaveDataText;
MyText:TRaveText;
//MyPage2:TRavePage;
nMarginBottom, nMarginLeft, nMarginRight, nMarginTop: Double;
begin
with RvProject1 do
begin
SetLength(FechaCorte,10);
//A:=GetCurrentDir()+'\Data\NOMREP1.rav';
//ProjectFile:=GetCurrentDir()+'\Data\NOMREP1.rav';
//Open;
//LoadFromFile(GetCurrentDir()+'\Data\NOMREP1.rav');
//StoreRAV:=True;
//ZQuery2.Fields.Clear;
ZQuery2.Close;
ZQuery2.SQL.Clear;
ZQuery2.SQL.Add('Select');
ZQuery2.SQL.Add('NumeroEmpleado,');
ZQuery2.SQL.Add('Cargo,');
ZQuery2.SQL.Add('Nombre,');
ZQuery2.SQL.Add('Apellido,');
ZQuery2.SQL.Add('Format(Cedula,0),');
ZQuery2.SQL.Add('Ingreso,');
ZQuery2.SQL.Add('Format(SalarioMensual,2),');
ZQuery2.SQL.Add('Format(SalarioDiario,2),');
ZQuery2.SQL.Add('Format(CTDiario,2),');
ZQuery2.SQL.Add('DiasTrabajados,');
ZQuery2.SQL.Add('DiasLibres,');
ZQuery2.SQL.Add('CT,');
ZQuery2.SQL.Add('Ausencias,');
ZQuery2.SQL.Add('Format(SSO,2),');
ZQuery2.SQL.Add('Format(RPE,2),');
ZQuery2.SQL.Add('Format(FAOV,2),');
ZQuery2.SQL.Add('Format(TotalSueldo,2),');
ZQuery2.SQL.Add('Format(TotalSanciones,2),');
ZQuery2.SQL.Add('Format(TotalCT,2),');
ZQuery2.SQL.Add('Format(TotalDiasLibres,2),');
ZQuery2.SQL.Add('Format(TotalAusencias,2),');
ZQuery2.SQL.Add('Format(TotalAsignaciones,2),');
ZQuery2.SQL.Add('Format(TotalDeducciones,2),');
ZQuery2.SQL.Add('Format(TotalCobrar,2)');
ZQuery2.SQL.Add('From Constructor.ZRepNom');
//ZQuery2.Open;
//ZQuery2.Close;
{
SetLength(MyFields, ZQuery2.FieldDefs.Count);
//Add one by one the fields to make them accesible.
for i:=0 to ZQuery2.FieldDefs.Count - 1 do
MyFields[i] := ZQuery2.FieldDefs[i].CreateField(ZQuery2);
//Create all Calculated Fields as you need
Temf := TStringField.Create(nil);
Temf.FieldKind := fkCalculated;
//Temf.FieldName := 'NewCalcField';
}
Open;
With ProjMan do
begin
Dataview := FindRaveComponent('DataView1',nil) as TRaveBaseDataView;
CreateFields(DataView, nil, nil, true); // refresh the dataview
end;
With ProjMan do
begin
MyPage := FindRaveComponent('Report1.Page1',nil) as TRavePage;
MyText := FindRaveComponent('FECHACORTE',MyPage) as TRaveText;
MyText.Text:=FechaCorte;
end; { with }
Save;
{
with IACProyectUnidades.ProjMan do
begin
nMarginBottom := 0.5;
nMarginLeft := 0.5;
nMarginRight := 0.5;
nMarginTop := 0.5;
end;
}
//seleccionamos el printer por defecto,
//asi salen los reportes tal cual queremos
//desde cualquier maquina con cualquier impresora
RpDev.SelectPrinter('microsoft xps document writer', False);
DireccionMisDocumentos:=GetMyDocuments;
if Not (DirectoryExists(DireccionMisDocumentos+'\Informes Luminatti\Nomina')) then
CreateDir(DireccionMisDocumentos+'\Informes Luminatti\Nomina');
//Label4.Caption:= 'Generando Reporte...';
RvSystem1.DefaultDest := rdFile;
RvSystem1.DoNativeOutput := false;
RvSystem1.RenderObject := RvRenderPDF1;
RvSystem1.OutputFileName := DireccionMisDocumentos+'\Informes Luminatti\Nomina\['+NOMREPMes.Text+' '+FechaCorte+']Reporte de Nómina.pdf';
RvSystem1.SystemSetups := RvSystem1.SystemSetups - [ssAllowSetup];
//ZConnection1.Connected:=False;
RvSystem1.Execute;
//Label4.Caption:= 'Reporte Generado!';
ShellExecute(FormPrincipal.Handle,nil,PChar(DireccionMisDocumentos+'\Informes Luminatti\Nomina\['+NOMREPMes.Text+' '+FechaCorte+']Reporte de Nómina.pdf'),'','',SW_SHOWMAXIMIZED);
end;
end;