Autor Beitrag
Luzifer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: Sa 16.04.05 19:00 
hi leute,

laut delphi hilfe gibt printersetup.execute einen booleanwert zurück, aber wenn ich das abfrage (printersetup.execute=true) dann sagt er mir "Record, Objekt oder Klassentyp erforderlich".....

mal zu meinem ziel: ich möchte ein quickreport drucken, report.print funktioniert auch, aber ich möchte gerne noch die möglichkeit für einstellungen haben...

greez Luzifer
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Sa 16.04.05 20:44 
Moin!

Hast du auch die entsprechende Komponente auf die Form gezogen und ist PrinterSetup auch der richtige Name der Komponente auf der Form?

MfG
Muetze1
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: Sa 16.04.05 21:17 
Hallo,

Der Aufruf muss so erfolgen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
//...
uses Printers;
//...
//vorher Windows Standard-Drucker setzen
printers.printer.printerindex :=-1;//sonst Fehlermeldung bei zweiten Aufruf
QuickRep1.PrinterSetup;

weitere Informationen:
Using the Printer setup dialog in QR4

//edit : was vergessen

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

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: Sa 16.04.05 22:38 
hmm ok das funktioniert jetzt, aber jetzt hab ich zwei andere probleme ;) :
-wenn ich abbrechen klicke druckt er trotzdem
-die einstellungen vom printerdialog werden nicht übernommen, sondern er druckt mit den standarteinstellungen....

thx for help
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: So 17.04.05 14:39 
Hallo,

hm, .. scheint ein Bug unter NT/XP zu sein,
hab mir mal das Beispielprojekt von Delphi 3 vorgenommen, damit treten die gleichen Probleme auf.

Dort werden verschiedene Probleme zu dem Thema angesprochen:
Home of QuickReport : DIY Fixes

Du schreibst das der Standarddrucker immer genutzt wird. Setz doch vor dem Druck den Standard-Drucker entsprechend der Auswahl im normalen Delphi-Druckersetupdialog, nach dem Druck wieder zurück.
Auf der DIY Fixes-Seite ist auch ein Code zum setzen des Standard-Druckers verlinkt:
"Setting the Default Printer from code"

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



BeitragVerfasst: So 17.04.05 15:23 
user profile iconLuzifer hat folgendes geschrieben:
hmm ok das funktioniert jetzt, aber jetzt hab ich zwei andere probleme ;) :
-wenn ich abbrechen klicke druckt er trotzdem


War bei mir auch immer

ausblenden Delphi-Quelltext
1:
if PrintDialog1.execute = false then exit;					


So habe ich das gelöst;

mfg
schuetz10
Luzifer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: So 17.04.05 21:52 
danke dir, aber bei mir sagt er das seien inkompatible typen...
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: So 17.04.05 22:07 
wann, wobei?

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

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: So 17.04.05 22:10 
bei
ausblenden Delphi-Quelltext
1:
if QuickRep1.printersetup = false then exit;					


bzw. bei
ausblenden Delphi-Quelltext
1:
if QuickRep1.printersetup.execute = false then exit;					


Record, Objekt oder Klassentyp erforderlich
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Mo 18.04.05 01:27 
Moin!

Steht denn in den Beispielen irgendwas von QuickRep1 oder irgendwas von PrinterSetup? Nein, dort steht PrintDialog1.execute - und das ist was anderes. Wir reden die ganze Zeit nicht direkt vom QuickReport sondern von dem PrinterSetup Dialog, den du aufrufen musst. Dazu musst du diesen erstmal auf die Form ziehen (TabReiter "Dialoge") und dann kannst du es auch so aufrufen wie es hier gezeigt wurde...

MfG
Muetze1
Luzifer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: Mo 18.04.05 09:25 
das weiß ich, aber wieso soll ich den seperaten dialog benutzen wenn beim quickreport einer dabei ist??

davon mal abgesehen, rede ICH schon die ganze zeit von quickreport ("mal zu meinem ziel: ich möchte ein quickreport drucken, report.print funktioniert auch, aber ich möchte gerne noch die möglichkeit für einstellungen haben... ")
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Mo 18.04.05 17:49 
Ok, schon gut - dann habe ich auch keine Hilfe für dich...
... was sowieso egal ist
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: Mo 18.04.05 23:38 
Hallo,
user profile iconLuzifer hat folgendes geschrieben:
bei
ausblenden Delphi-Quelltext
1:
if QuickRep1.printersetup = false then exit;					


>> printersetup ist kein Boolean-Typ, daher "inkompatible Typen"

user profile iconLuzifer hat folgendes geschrieben:

bzw. bei
ausblenden Delphi-Quelltext
1:
if QuickRep1.printersetup.execute = false then exit;					

Record, Objekt oder Klassentyp erforderlich

>> Delphi-Hilfe zu = printersetup = "This macro does not take any parameters."
daher "Record, Objekt oder Klassentyp erforderlich"

Die Quickreport-Komponente verwaltet ein eigenes Printerobjekt,
und das hat den in meinem vorigen Post erwähnten Bug.

Hast Du meine Links bzw. Hinweise gelesen, googeln nach Quickreport und printersetup fördert noch mehr Hinweise zu dem Thema hervor.

Deshalb vllt. auch die wiederholten Vorschläge mit dem Delphi-PrintDialog.

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

WinXP Pro/ Vista
D5 Enterprise/D7 Enterprise/D2005 Architect
BeitragVerfasst: Di 19.04.05 14:25 
danke dir!