Jump to content

Recommended Posts

Posted

Hi

 

I use Report Builder for preview my report.

If the query don't answer the report file don't created in UniServerModule.NewCacheFileUrl    folder .

I checked every time, no files created.
And I want to not open the preview form if it is not answered, and the message of ( Not Found ) is displayed.
 
How should I do this?
 
function TrepDataModule.GenRep(const InvN: string): string;
var
 lPDFDevice:  TppPDFDevice;
begin
  InvNum := InvN;
  OpenDS();
  lPDFDevice    := TppPDFDevice.Create(nil);
  try
    lPDFDevice.PDFSettings := ppReport1.PDFSettings;
    lPDFDevice.FileName    := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);
    lPDFDevice.Publisher   := ppReport1.Publisher;

    // generate the report

    ppReport1.PrintToDevices;
  finally
    lPDFDevice.Free;
    CloseDS;
  end;
end;

I Insert 

   if Not(lPDFDevice.FileName<>'') then
     Begin
      Showmessage('Not Found...');
      Exit
     End;

But all of time message showed.

 

 

Best Regards.

 

 

 

Posted
function TrepDataModule.GenRep(const InvN: string): string;
var
lPDFDevice: TppPDFDevice;
AUrl,ArquivoSaida:string;
begin
 
AUrl         :='';
ArquivoSaida :=  UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl, True);

InvNum := InvN;
OpenDS();
lPDFDevice := TppPDFDevice.Create(nil);
try
lPDFDevice.PDFSettings := ppReport1.PDFSettings;
lPDFDevice.FileName := ArquivoSaida;
lPDFDevice.Publisher := ppReport1.Publisher;

// generate the report

ppReport1.PrintToDevices;
finally
lPDFDevice.Free;
CloseDS;
end;
end;
      
 
use aUrl for show report in form with tunipdfframe
Posted

Hi

 

 

I use Demo function and don't have any problem.My problem is:

If the query of related report is empty ,how to can you find out?

And show message?

 

 

Best Regards.

Posted

Hi,

 

If I understand you correctly, simple use isEmpty function of your DataSet

if not DataSet.isEmpty then
begin
  // create report
end
else
  // not found
Posted

Hi

 

Each report has an internal query that has difficulty accessing its data, and the result is empty.
I wanted to know if you could understand how to create it in the following directory before reporting it.
 

(lPDFDevice.FileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);)

 

How to understand If  Report Builder do not create the file in the top folder

I use this command

if Not(lPDFDevice.FileName<>'') then

But It don't  work correctly.

 

 

Best Regards.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...