Jump to content

connection error


jahlxx

Recommended Posts

Hi.

 

When launch a long process taht takes some time, appears the message inthe borwser:

 

Connection Error communication failure

Retrying ....

 

 

This is not real, because the process ends ok, but is extrange for the end user.

 

Any idea about this?

 

Thanks.

Link to comment
Share on other sites

Ok.

 

I've been testing, but is extrabge for me.

 

I have this:

 

procedure Tlib.rptpdf(rep: tquickrep);
var
   xreport: string;
   FileName:string;
begin
   try
   xreport := 'reportname.pdf';

   rep.prepare;
   rep.ExportToFilter(tqrPDFDocumentfiltER.Create(xreport));

   UniSession.SendFile(xreport,xreport);

   except on E : Exception do begin
      lib.error('error raised, with message : ' + E.Message);
      end;
   end;
end;

 

And I'd like to do these two lines in a separated thread:

   rep.prepare;
   rep.ExportToFilter(tqrPDFDocumentfiltER.Create(xreport));

 

 

But I don't know how to do it.

 

I need some help, please.

 

Thanks.

Link to comment
Share on other sites

  • 5 months later...

Hi.

 

Based on threadtimer demo, I've what I need.

 

But I have some problems or I don't know how to do some things. Sure due to my ignorance. I've never worked with threads.

 

1. I generate a report in pdf in background. when finish, I call sendfile, but this sentence don't execute.

 

2. when I create a thread, any reference to another unit different to the unit where the thread is created, raises an error (the thread is not executed or stops).

 

3. some variables values, can't be accessed from the thread.

 

Some help?

 

Thanks.

Link to comment
Share on other sites

Hi.

 

reviewing the unitimer sample, I see this in the code.

 

// *Important *//
// Thread Timer event should not call any GUI related code
// It runs in a separate thread, so it will fail if you interact with GUI components here
 

 

Is this the reason of my issue? (points 2 and 3).

 

If yes, how can I solve? In the thread execution, I need to access to values of some uniedits values, in the same form, or in other forms. I don't know how to solve this.

 

Thanks.

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...