Ver Mensaje Individual
  #5  
Antiguo 18-11-2005
Avatar de nuk3zito
nuk3zito nuk3zito is offline
Miembro
 
Registrado: ago 2003
Ubicación: "Z" Land
Posts: 244
Reputación: 21
nuk3zito Va por buen camino
Aquí va un ejemplo más sencillo utilizando los componentes TCrpe (para el reporte) y TCrpeDS (para ligar a un dataset desde delphi sin tener que ejecutar de nuevo todo dentro del Crystal Reports).

Código Delphi [-]
  try
    crpeDS1.DataSet:= mdDatos;
    Crpe1.ReportName:= FMenuPrinc.sFilesLocation+'walkaround.rpt';
    Crpe1.DiscardSavedData;
    Crpe1.Tables[0].DataPointer := CrpeDS1.DataPointer;

    for i:= 1 to DBGrid1.Columns.Count - 1 do
      Crpe1.FormulabyName('Mes' + IntToStr(i)).Formula.Text :=
        '''' + DBGrid1.Columns[i].Title.Caption + '''';
    Crpe1.WindowStyle.Title:= 'Reporte de Walkaround';
    Crpe1.Execute;
  except
    On E: Exception do
    begin
      Application.MessageBox('Ocurrió un error al generar el reporte!',
        pchar(Caption), mb_ok + mb_iconerror);
      Application.MessageBox(pchar(E.Message),
        pchar(Caption), mb_ok + mb_iconerror);
    end;
  end;

Espero que les sirva...
Saludos
__________________
Tiempo y ocasión acontecen a todos!
Responder Con Cita