AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

printgrid

Ein Thema von tom_po · begonnen am 1. Mai 2006 · letzter Beitrag vom 3. Mai 2006
Antwort Antwort
tom_po

Registriert seit: 5. Feb 2006
137 Beiträge
 
Delphi 7 Enterprise
 
#1

printgrid

  Alt 1. Mai 2006, 04:53
Bekomme diese Fehlermeldung beim Drucken eines Stringgrid:
[Fehler] loteunit.pas(23): Ungenügende Forward- oder External-Deklaration: 'Tlote.PrintGrid'

hier meine Quelltext:

Delphi-Quellcode:
unit loteunit;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, printers, DB, dbisamtb, StdCtrls, shellapi,Mask, strutils,DBCtrls, Grids, DBGrids, dbisamct,suchunit,tnpdf;
 
type
  Tlote = class(TForm)
    Label1: TLabel;
    Label10: TLabel;
    DBISAMDBGrid1: TDBISAMDBGrid;
    DBISAMQuery1: TDBISAMQuery;
    DataSource1: TDataSource;
    order: TDBEdit;
    Artikel: TDBEdit;
    Button1: TButton;
    StringGrid1: TStringGrid;
    procedure deletetmppdf();
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
    procedure PrintGrid(sGrid: TStringGrid; sTitle: string);
 
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
 
var
  lote: Tlote;

implementation
 
{$R *.dfm}
 
function GetTempPathD: string;
var
  TmpDir: PChar;
begin
  TmpDir := StrAlloc(255);
  GetTempPath( 255,TmpDir);
  Result := string(TmpDir);
  if Result[Length(Result)] <> '\then
    Result := Result + '\';
  StrDispose(TmpDir);
end;
 
procedure Tlote.deletetmppdf();
var
  SR: TSearchRec;
begin
if FindFirst(gettemppathd+'tmp*.pdf', faAnyFile - faDirectory, SR) = 0 then
    repeat
     deletefile(gettemppathd+sr.name);
     until FindNext(SR) <> 0;
end;
 
procedure Tlote.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;

procedure PrintGrid(sGrid: TStringGrid; sTitle: string);
var
  X1, X2: Integer;
  Y1, Y2: Integer;
  TmpI: Integer;
  F: Integer;
  TR: TRect;
begin
  Printer.Title := sTitle;
  Printer.BeginDoc;
  Printer.Canvas.Pen.Color := 0;
  Printer.Canvas.Font.Name := 'Times New Roman';
  Printer.Canvas.Font.Size := 12;
  Printer.Canvas.Font.Style := [fsBold, fsUnderline];
  Printer.Canvas.TextOut(0, 100, Printer.Title);
  for F := 1 to sGrid.ColCount - 1 do
  begin
    X1 := 0;
    for TmpI := 1 to (F - 1) do
      X1 := X1 + 5 * (sGrid.ColWidths[TmpI]);
    Y1 := 300;
    X2 := 0;
    for TmpI := 1 to F do
      X2 := X2 + 5 * (sGrid.ColWidths[TmpI]);
    Y2 := 450;
    TR := Rect(X1, Y1, X2 - 30, Y2);
    Printer.Canvas.Font.Style := [fsBold];
    Printer.Canvas.Font.Size := 7;
    Printer.Canvas.TextRect(TR, X1 + 50, 350, sGrid.Cells[F, 0]);
    Printer.Canvas.Font.Style := [];
    for TmpI := 1 to sGrid.RowCount - 1 do
    begin
      Y1 := 150 * TmpI + 300;
      Y2 := 150 * (TmpI + 1) + 300;
      TR := Rect(X1, Y1, X2 - 30, Y2);
      Printer.Canvas.TextRect(TR, X1 + 50, Y1 + 50, sGrid.Cells[F, TmpI]);
    end;
  end;
  Printer.EndDoc;
end;
 
procedure Tlote.Button1Click(Sender: TObject);
begin
 PrintGrid(StringGrid1, 'Print Stringgrid');
end;

end.
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: printgrid

  Alt 1. Mai 2006, 07:37
Du hast .PrintGrid als Methode von Tlote deklariert. Implementierst es aber als freie Prozedur.
Markus Kinzler
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.140 Beiträge
 
Delphi 12 Athens
 
#3

Re: printgrid

  Alt 1. Mai 2006, 07:47
Im Klartext ... das Tlote. fehlt
Code:
procedure [color=#ff0000][b]Tlote.[/b][/color]PrintGrid
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
tom_po

Registriert seit: 5. Feb 2006
137 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: printgrid

  Alt 3. Mai 2006, 15:04
danke für eure hilfe
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz