Einzelnen Beitrag anzeigen

grenzgaenger
(Gast)

n/a Beiträge
 
#2

Re: StrinGrid mit Linien über Ravereport ausdrucken.

  Alt 3. Feb 2008, 19:51
mal ins blaue hinein geschossen

Delphi-Quellcode:
procedure TForm4.RvSystem1Print(Sender: TObject);
var
     I: Integer;
     RP1: TBaseReport;

     procedure PHeader(const rp1: TBaseReport);
     begin
          with RP1 do
          begin
               Home;
               // *** Seiteneinstellung
               SectionLeft := 0.5;
               SectionRight := PageWidth - 0.5;
               SectionTop := 1.0;
               SectionBottom := PageHeight - 1.5;

               SetFont ('Arial', 16);
               FontColor := clNavy;
               Bold := True;
               PrintCenter ('Raumverwaltung', PageWidth / 2);
               Bold := False;
               NewLine;
               NewLine;
               SetFont ('Arial', 12);
               FontColor := clBlack;

               ClearTabs;
               SetTab (SectionLeft, pjCenter, 1.0, 5, BoxLineAll, 5);
               SetTab (SectionLeft, pjCenter, 2.2, 5, BoxLineAll, 5);
               SetTab (SectionLeft, pjCenter, 3.4, 5, BoxLineAll, 5);
               SetTab (SectionLeft, pjCenter, 4.6, 5, BoxLineAll, 5);
               SetTab (SectionLeft, pjCenter, 5.8, 5, BoxLineAll, 5);
               SetTab (SectionLeft, pjCenter, 7.0, 5, BoxLineAll, 5);
             // SetTab (NA, pjCenter, PageWidth - 2, 5, BoxLineAll, 5);

               Bold := True;
               PrintTab ('Raum');
               PrintTab ('belegt');
               PrintTab ('von');
               PrintTab ('bis');
               PrintTab ('als');
               PrintTab ('Bemerkung');
               Bold := False;
               NewLine;

          end;
     end;
begin
     RP1 := Sender as TBaseReport;
     with RP1 do
     begin
          PHeader(rp1) // *** Seitenkopf
          for I := 1 to StringGrid1.RowCount - 1 do
          begin
               if LinesLeft < 5 then // Neue Seite
               begin
                    NewPage;
                    PHeader(rp1);
               end;
               PrintTab (StringGrid1.Cells[1,I]);
               PrintTab (StringGrid1.Cells[2,I]);
               PrintTab (StringGrid1.Cells[3,I]);
               PrintTab (StringGrid1.Cells[4,I]);
               PrintTab (StringGrid1.Cells[5,I]);
               PrintTab (StringGrid1.Cells[6,I]);
               NewLine;
          end;
     end;
end;
probier es mal so ...
  Mit Zitat antworten Zitat