Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Printing
Wed, Sep 4 2013 6:21 AMPermanent Link

Matthew Jones

Anyone know if it is possible to control the printing in a browser? I'm just
pondering converting an internal utility to EWB, and it prints labels, so it needs
to be sort of precise. If it isn't even practical I won't start, but if it was...

/Matthew Jones/
Wed, Sep 4 2013 8:01 PMPermanent Link

Robert Horbury-Smith

This may not be practicle, but might be worth a look :

http://www.digital-metaphors.com/products/server.html

Cheers

Rob

Matthew Jones wrote:

> If it isn't even practical I won't start, but if it was...
Thu, Sep 5 2013 9:46 AMPermanent Link

Matthew Jones

"R Horbury-Smith" <rhorbry@iinet.net.au> wrote:
> This may not be practicle, but might be worth a look :
>
> http://www.digital-metaphors.com/products/server.html
>
> Cheers
>
> Rob
>
> Matthew Jones wrote:
>
>> If it isn't even practical I won't start, but if it was...

Thanks. I had considered generating PDF, but not sure how practical that is
for the user to print from either.

--
Matthew Jones
Fri, Sep 6 2013 3:03 AMPermanent Link

MalcolmC

Avatar

Hi Mathew

Not sure if you are aware that Fast Reports "Enterprise" has Components
for web-applications.

Version Matrix here ...

http://www.fast-report.com/en/products/report-for-delphi-fastreport-4-feature-matrix.html/

Malcolm
Townsville, Australia


On 4/09/2013 8:21 PM, (Matthew Jones) wrote:
> Anyone know if it is possible to control the printing in a browser? I'm just
> pondering converting an internal utility to EWB, and it prints labels, so it needs
> to be sort of precise. If it isn't even practical I won't start, but if it was...
>
> /Matthew Jones/
>
Fri, Sep 6 2013 9:47 AMPermanent Link

Matthew Jones

http://stackoverflow.com/questions/12997123/print-specific-part-of-webpage

This looks hopeful, though you'll get the browser headers I guess. I can probably
fix that with a custom browser I suppose...

/Matthew Jones/
Fri, Sep 6 2013 9:50 AMPermanent Link

Walter Matte

Tactical Business Corporation

I use ReportBuilder Enterprise (Pro can do it too) to generate a PDF.

rptMain - it the Report component.

In this a snip it - it is MSSQL UniDac  (DevArt) backend with RealThinClient http server...


function TdmUniSQL.EWBPrintInvoice(Query: TRtcHttpValues): string;
var
 HD: TppPDFDevice;
 ST: TStringStream;
 i : integer;
 iWebTimeId : integer;
begin
//  Log('EWBPrintInvoice ', 'EWB');

 iWebTimeId := 0;    
 
 for i := 0 to Query.ItemCount - 1 do
 begin
   if Uppercase(Query.ItemName[i]) = 'WEBTIMEID' then
     iWebTimeId := StrToInt(Query.ItemValue[i]);
 end;

 tbTimeInv.Close;
 tbTimeInv.FilterSQL := 'WebTimeId=' + IntToStr(iwebTimeID);
 tbTimeInv.Filtered := True;
 tbTimeInv.Open;

 if qTimeOther.Active then
   qTimeOther.Close;
 qTimeOther.ParamByName('PID').AsInteger := tbTimeInv.FieldByName('PositionsID').AsInteger;
 qTimeOther.Open;
 
// ******* Here is the Report Builder part

 ST := TStringStream.Create('');
 HD := TppPDFDevice.Create(Self);
 HD.OutputStream := ST;
 HD.Publisher := rptMain.Publisher;
 rptMain.PrintToDevices;

 result := ST.DataString;    // Send Back PDF

 qTimeOther.Close;
 tbTimeInv.Close;
 
 FreeAndNil(st);
 FreeAndNil(hd);
end;


I have a provider routine that obtains the request ... this is specifically doing the response for the Inoivce

       Conn := FConnections.LockConnection;
       try

         // Setup PDF Response....

         Response.ContentType := 'application/pdf';
       
         Response.HeaderText :=
              Response.HeaderText +
                RtcString('Access-Control-Allow-Origin: *' + #13#10) +
                RtcString('Cache-Control: must-revalidate, post-check=0, pre-check=0' + #13#10) +
                RtcString('Cache-Control: public' + #13#10) +
                RtcString('Content-Description: File Transfer' + #13#10) +
                RtcString('Content-Disposition: attachment; filename=Report.pdf' + #13#10);
         
         Write(RtcString(Conn.EWBPrintInvoice(Request.Query)));    // ****** Calling the EWBPrintInvoice
       finally
         FConnections.UnlockConnection(Conn);
       end;
     end;

Nice thing about Report Builder - just change the device (  HD: TppPDFDevice; ) to the Excel, or Word or HTML device and you can send your report back anyway you probably need to.

Walter



Matthew Jones wrote:

"R Horbury-Smith" <rhorbry@iinet.net.au> wrote:
> This may not be practicle, but might be worth a look :
>
> http://www.digital-metaphors.com/products/server.html
>
> Cheers
>
> Rob
>
> Matthew Jones wrote:
>
>> If it isn't even practical I won't start, but if it was...

Thanks. I had considered generating PDF, but not sure how practical that is
for the user to print from either.

--
Matthew Jones
Image