Autor Beitrag
bruce185
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Sa 10.09.05 20:39 
hi,
ich habe ein Trainingsplan in Delphi 7 geschrieben, und ich habe ein Button eingefügt für Druckvorschau, wenn ich da drauf klicke, dann öffnet sich ein neues Fenster mit RichEdit, nur wie kann ich Tabellen in RichEdit einfügen, geht das? ich bin euch für jede hilfe sehr dankbar, danke schonmal. :)

Andreas


Moderiert von user profile iconChristian S.: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am So 11.09.2005 um 13:36
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: So 11.09.05 12:30 
TRichedit kann soweit ich weiss keine Tabellen. Probiers mal mit THTML.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 11.09.05 13:35 
Ich hab noch keine Kostenloses RichEdit mit Tabellenunterstützung gefunden. Die wpTools haben das, sind aber kostenpflichtig.
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Mo 12.09.05 23:52 
danke für die Antwort, das ist so, ich habe ein Trainingsplan in Delphi geschrieben, das sieht folgendermasen aus:

www.1200kb.net/uploadimg/file351603680.bmp

und wenn ich auf Druckvorschau klicke dann öffnet sich ein eues Fenster mit TRichEdit, und wenn man auf Drucken klickt, dann soll dass so ähnlich ausgedruckt werden wie auf das bild geformt, geht das?, ich bin euch sehr dankbar für die weitere hilfen :)

Andreas


Zuletzt bearbeitet von bruce185 am Mo 12.09.05 23:58, insgesamt 1-mal bearbeitet
NCortex
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 126

WIN 2000
D7 Enterprise
BeitragVerfasst: Mo 12.09.05 23:57 
du könntest es einfach auf den canvas vom Drucker malen lassen...

_________________
"...by all means, do not use a hammer." (aus einer IBM Technikerdokumentation ca. 1920)
--->außer es kam von Microsoft<---
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 13.09.05 00:01 
Ich würde kein RichEdit nehmen, sondern ein StringGrid. Und da würde ich das TAdvStringGrid von www.tmssoftware.com benutzen, das hat schon eine eingebaute Druckvorschau. Für den privaten Gebrauch ist es Freeware.
Krumnix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60

Win98,2000,XP
Delphi 7 Enterprise
BeitragVerfasst: Fr 23.09.05 13:48 
user profile iconSpaceguide hat folgendes geschrieben:
TRichedit kann soweit ich weiss keine Tabellen. Probiers mal mit THTML.


Doch kann es ;-)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
 MyRTFList := TStringList.Create;

 MyMS := TMemoryStream.Create;
  try
   MyRTFList.Add('\par\trowd\trgaph50\cellx610\cellx2260\cellx2820\cellx7920\cellx8900\cellx10000\intbl Überschrift Spalte 1\cell Überschrift Spalte 2\cell Überschrift Spalte 3\cell Überschrift Spalte 4\cell Überschrift Spalte 5\cell Summe\cell\row');

   MyRTFList.Add('\par\intbl ' + Form1.Edit1.Text + '\cell ' + Form1.Edit2.Text + '\cell ' + Form1.Edit3.Text + '\cell\fs16 ' + Form1.Edit4.Text + '\cell\fs20 ' + Form1.Edit5.Text + '\cell ' + Form1.Edit6.Text + '\cell\row');

 MyRtfList.SaveToStream(MyMS);
 MyMS.Seek(soFromBeginning,0);
 RichEdit1.PlainText := False;
 RichEdit1.Lines.LoadFromStream(MyMS);

_________________
Kommt Zeit kommt Rat.... In der Tat
Ich kann mehr auswendig als ich mir merken kann.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 23.09.05 17:01 
Hallo,

user profile iconKrumnix hat folgendes geschrieben:
Doch kann es ;-)

das stimmt, ist aber abhängig vom Betriebssystem bzw. der genutzten riched**.dll

Mit Deinem Code wird das nicht funktionieren, Ergebnis:
Zitat:
---------------------------
Project1
---------------------------
Zugriffsverletzung bei Adresse 74DEE249 in Modul 'RICHED20.dll' Lesen von Adresse 00000004.
---------------------------
OK
---------------------------


Mindestanforderungen um eine RTF mit Tabelle auf dem Wege anzuzeigen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var MyMS: TMemoryStream;
    MyRTFList : TStringList;
begin
  MyRTFList := TStringList.Create;
  MyMS := TMemoryStream.Create;
  try
   MyRTFList.Add('{\rtf1');// <--- !! fehlt die Zeile >> Zugriffsverletzung.
   MyRTFList.Add('\par\trowd\cellx610\cellx2260\cellx2820\cellx7920\cellx8900\cellx10000\intbl Überschrift Spalte 1\cell Überschrift Spalte 2\cell Überschrift Spalte 3\cell Überschrift Spalte 4\cell Überschrift Spalte 5\cell Summe\cell\row');
   MyRTFList.Add('\par\intbl ' + Form1.Edit1.Text + '\cell ' + Form1.Edit2.Text + '\cell ' + Form1.Edit3.Text + '\cell\fs16 ' + Form1.Edit4.Text + '\cell\fs20 ' + Form1.Edit5.Text + '\cell ' + Form1.Edit6.Text + '\cell\row');
   MyRTFList.Add('}');// <--- !! alle geöffneten geschweiften Klammern müssen geschlossen werden
                      //         fehlt die Zeile, wird nur der RTF-Code angezeigt.
   MyRtfList.SaveToStream(MyMS);
   MyMS.Seek(soFromBeginning,0);
   RichEdit1.PlainText := False;
   RichEdit1.Lines.LoadFromStream(MyMS);
  finally
    MyRTFList.Free;
    MyMS.Free;
  end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Krumnix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60

Win98,2000,XP
Delphi 7 Enterprise
BeitragVerfasst: Fr 23.09.05 20:07 
Das ist richtig. Nur wollte ich jetzt nicht alles posten, sondern nur den Teil, der die Benutzung der Tabelle aufweist.
Mit deinem zugefügten Code sollte es aber jetzt wirklich "einfach" sein, das hinzubekommen :wink:

_________________
Kommt Zeit kommt Rat.... In der Tat
Ich kann mehr auswendig als ich mir merken kann.