Jump to content

How to find that Report Builder file is Created?


Ario.Paxaz

Recommended Posts

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.

 

 

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...