Home Server

AbsolutePageCount in TrsClientReport

edited May 2004 in Server
Hello,

In a tray-application we where checking at regular times if some
closing reports could be produced. Until now this was a regular
tppreport.

As all our reports run now with a RbServer we wanted to migrate this
module to. But we are using a technique to 'sense' if a report has
been produced or due to any reason no data was found yet.

This was a part of the code

// Set Output Device

rsClientReport.DeviceType := dtArchive;

rsClientReport.NoDataBehaviors := [ndBlankPage];

rsClientReport.ShowAutoSearchDialog := False;

rsClientReport.ShowPrintDialog := False;

RepLocation := CheckDir(RepName,
CompName, intToStr(xYear));

rsClientReport.ArchiveFileName := RepLocation + 'Week_' +
FormatFloat('00', Int(xWeek)) + '.Raf';

// Print The Report

rsClientReport.Print;

// Check if Printed

if rsClientReport.AbsolutePageCount = 0 then

begin

if FileExists(rsClientReport.ArchiveFileName) then

DeleteFile(rsClientReport.ArchiveFileName);

end

else

begin

CodeSite.SendString('Report', rsClientReport.ArchiveFileName);


dsetRbRun.Insert;

dsetRbRun.FieldByName('ITEM_ID').AsInteger := RepItemId;

dsetRbRun.FieldByName('RBRUN_DATE').AsDateTime := Now;

dsetRbRun.FieldByName('RBRUN_OBJECT').AsString := CompId;

dsetRbRun.FieldByName('RBRUN_PERIOD').AsString :=
FormatFloat('0000', Int(xYear)) + FormatFloat('00', Int(xWeek));

dsetRbRun.Post;

end;

But with the TrsClientReport there is no NoDataBehaviours and no
AbsolutePageCount.

Is there another way to achieve this ??



Thx

Comments

  • edited May 2004

    As mentioned in my post above, the Server is going to force a
    NoDataBehaviors setting of ndBlankReport so that the Client always receives
    a page back from the server.

    You may want to configure the reports with the ndBlankReport and
    ndMessgeOnPage settings so that a 'No Data Found' message is printed on each
    page.

    On the client side you could use the Device.OnPageReceive event to check
    whether the first page contains a TppDrawText drawcommand object with the
    Text 'No Data Found'.

    You can use the ClientReport.BeforePrint event to access the
    Report.FileDevice object (i.e. the ArchiveFileDevice) and assign the event
    handler. The signature of the event is defined in ppTypes:

    TppPageEvent = procedure (Sender: TObject; aPage: TObject) of object;





    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.