Discussion:
BaseReport.SelectPrinter
(too old to reply)
Wim
2006-09-07 14:56:20 UTC
Permalink
Hi,

I created some kind of automated printing using Rave Reports. I have the
code like this:

procedure tForm1.Button1(Sender: TObject);
begin
RvSystem1.execute;
end;

procedure tForm1.RvSystem1Print(Sender: TObject);
begin
with RvSystem1.Basereport do
begin

// Here comes the code for printing

end;
end;

This works perfect with the default printer, but I like to select the
printer automatically, because I want so sent one copy to the default
printer and a second copy to another printer in the network.
I already tried to use Basereport.Selectprinter(*printer*). But, depending
on where I put it, it didn't do anything or it created the error "Report
already printing".

Does anyone know a simple solution for this?

Thx, Wim.
Karol Bieniaszewski
2006-09-08 11:24:30 UTC
Permalink
Post by Wim
Hi,
I created some kind of automated printing using Rave Reports. I have the
procedure tForm1.Button1(Sender: TObject);
begin
RvSystem1.execute;
end;
procedure tForm1.RvSystem1Print(Sender: TObject);
begin
with RvSystem1.Basereport do
begin
// Here comes the code for printing
end;
end;
This works perfect with the default printer, but I like to select the
printer automatically, because I want so sent one copy to the default
printer and a second copy to another printer in the network.
I already tried to use Basereport.Selectprinter(*printer*). But, depending
on where I put it, it didn't do anything or it created the error "Report
already printing".
Does anyone know a simple solution for this?
Thx, Wim.
Where are you using Basereport.Selectprinter(*printer*)?

your code should by like this

procedure tForm1.Button1(Sender: TObject);
begin
RvSystem1.execute;
Basereport.Selectprinter(*printer*)?
//here add some params to not show dialog ...
RvSystem1.execute;
end;

procedure tForm1.RvSystem1Print(Sender: TObject);
begin
with RvSystem1.Basereport do
begin

// Here comes the code for printing
end;
end;

Karol Bieniaszewski

Loading...