Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 13:26

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 21 Dec 2022, 05:07 
Offline

Joined: 31 Aug 2018, 19:06
Posts: 92
Hi, I need the printer selected by the user for printing on after or before print similar on printdatacell


Top
 Profile  
 
PostPosted: 21 Dec 2022, 08:47 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

You can use TPrintDialog to allow user to select a printer
Then call PrintDBGridEh1.Print;
Like this

Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (PrintDialog1.Execute) then
    PrintDBGridEh1.Print;
end;


PrintDBGridEh will print the grid to the selected printer.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 21 Dec 2022, 08:49 
Offline

Joined: 31 Aug 2018, 19:06
Posts: 92
I mean the printer that the user chooses, maybe select default or other


Top
 Profile  
 
PostPosted: 21 Dec 2022, 09:01 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
The user selects a printer using the TPrintDialog component.
Or not?

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 21 Dec 2022, 09:43 
Offline

Joined: 31 Aug 2018, 19:06
Posts: 92
In the print form, it is possible for the user to change the current printer
in fact i want access "VPrinter: TVirtualPrinter"
on afterprint or beforprint event
"I use PrintDBGridEh1.Preview "


Top
 Profile  
 
PostPosted: 23 Dec 2022, 05:55 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

Please write why you can't use TPrintDialog to select a printer?

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 01 Jan 2023, 05:40 
Offline

Joined: 31 Aug 2018, 19:06
Posts: 92
I first show preview with follow code:
Code:
PrintDBGridEh1.Preview

then user may change default printer & then print in preview form
I want in onAfterprint Or onBeforePrint access to VPrinter similar onPrintDataCell


Top
 Profile  
 
PostPosted: 13 Feb 2023, 06:32 
Offline

Joined: 31 Aug 2018, 19:06
Posts: 92
Hi, unfortunately, we have sent several posts for several days, but we have not received a response


Top
 Profile  
 
PostPosted: 05 Apr 2023, 17:11 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

When printing, PrintDBGridEh uses a virtual printer, which is passed to the TPrintDBGridEh.PrintTo method
Preview uses the global object PrViewEh.PrinterPreview
When printing to a printer, the PrntsEh.VirtualPrinter global object is used.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group