Another NoData question...
I need to do certain API calls to determine if a record should be shown or
not. This means, I can not fully use a query. I simply hide every detail
band that is not supposed to show. All this works well. The only problem I
have is, that obviously the "NoData" event is not triggered if all of the
returned rows are hidden. Is there a way to simulate this inside the Report?
I have other reports that do not use this method but solely rely on the
query. In this case a message that no records where found is been printed in
the middle of the report page. I simply want all reports to behave the same.
--
-------------------------------------------------------------------
Marco Heine
QUMAS
Enterprise Compliance Management
Visit our Website: www.qumas.com
not. This means, I can not fully use a query. I simply hide every detail
band that is not supposed to show. All this works well. The only problem I
have is, that obviously the "NoData" event is not triggered if all of the
returned rows are hidden. Is there a way to simulate this inside the Report?
I have other reports that do not use this method but solely rely on the
query. In this case a message that no records where found is been printed in
the middle of the report page. I simply want all reports to behave the same.
--
-------------------------------------------------------------------
Marco Heine
QUMAS
Enterprise Compliance Management
Visit our Website: www.qumas.com
This discussion has been closed.
Comments
You would need to add some logic to show the message on the page.
You could try creating a DrawText drawcommand to show the message. The
code below shows how the report engine does this. In your own code, you
can access the page property via Report.Engine.Page. Perhaps put this
code in the Report.OnEndPage event.
var
liTextHeight: Integer;
liTextWidth: Integer;
liPageWidth: Integer;
lDrawText: TppDrawText;
begin
lDrawText := TppDrawText.Create(Page);
lDrawText.Autosize := True;
lDrawText.Font.Name := 'Arial';
lDrawText.Font.Size := 12;
lDrawText.Font.Color := clBlack;
lDrawText.IsMemo := False;
lDrawText.Text := ppLoadStr(1034); {'No Data Found.'}
lDrawText.Transparent := True;
lDrawText.WordWrap := False;
liTextWidth := 110;
liTextHeight := 18;
lDrawText.Height := ppToMMThousandths(liTextHeight, utScreenPixels,
pprtVertical, nil);
lDrawText.Width := ppToMMThousandths(liTextWidth, utScreenPixels,
pprtHorizontal, nil);
liPageWidth := Page.PageDef.mmPrintableWidth;
lDrawText.Left := (liPageWidth - lDrawText.Width ) div 2;
lDrawText.Top := (SpaceUsed - lDrawText.Height) div 2;
Result := lDrawText;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com