FoxInCloud
Heavy Report
Gravatar is a globally recognized avatar based on your email address. Heavy Report
  Arcadio Bianco
  All
  Jun 23, 2020 @ 04:57am

Hi!

What is the best way to generate a heavy report (Multiple queries and pages) using FoxInCloud. Any tips?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jun 24, 2020 @ 01:33am

Hi Arcadio,

What kind of tip are you looking for? reduce response time, reduce user waiting time, other?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Jun 24, 2020 @ 05:12am

Hi, Thierry!

A report that takes 10 minutes to generate. Foxincloud will generate me timeout errors. Right?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jun 24, 2020 @ 09:27am

You just need to expand Timeout in wc.ini to 600 (secs.), or more if you see fit.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Jun 24, 2020 @ 09:39am

Have you ever done something asynchronous?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jun 25, 2020 @ 02:35am

FoxInCloud has no such feature; you can look at Web Connect's wwWebAsyncRequest

Otherwise if your report can be generated by an independent procedure, you can do the following:

  • JS Event handler:
    1. collect report parameters from controls on the form (jQuery("#ID").val()…)
    2. send an async AJAX request to a dedicated xxxProcess.myReport() method with report parameters as form name-values pairs
    3. As AJAX request call back, display a 'report complete' message with a link to the report in some Bootstrap Notify 'window'
  • xxxProcess.myReport() does the following:
    1. collect report parameters using request.form()
    2. run report in independent procedure with parameters
    3. copy PDF report into site's temp folder with user's ID added to file stem for uniqueness and confidentiality (you can use this.oAJAX.FileToSiteTempDir())
    4. return JSON result including URL to the temp/report_userID.pdf; the above AJAX request call-back processes this result.

Benefit of that procedure is that user can continue working until the report is complete; however he/she must stay in the same page for the call-back to execute properly.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  Arcadio Bianco
  Jun 25, 2020 @ 09:50am

It would be interesting if you had a small example in the live tutorial of the following steps. It's definitely something that would be really cool for the product.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jun 25, 2020 @ 10:35am

OK will try to do soon

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Jun 25, 2020 @ 12:07pm

Great! Thank you!

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Tore Bleken
  Arcadio Bianco
  Jun 25, 2020 @ 12:40pm

I had a similar need many years ago. My web application simply created a text file with a random name in a special folder, this text file included all the necessary details to define the report, plus the email address to the one who asked for the report. A second program regularly checked the folder in question, and if a file was found, it was analyzed and the report was created as a PDF. Then the PDF was simply sent as an email attachment. The second program was also responsible for deleting old PDFs in order to avoid storing unnecessary files.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Tore Bleken
  Jun 25, 2020 @ 11:34pm

Nice solution, thanks Tore

Arcadio, does it fit your immediate need?
(while I remain committed to adding an example to FLT's reporting sample form 😉)

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Arcadio Bianco
  Jun 26, 2020 @ 06:35am
Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jun 26, 2020 @ 08:23am

Hi Thierry,

Elegant !

I see you are using notify ()?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jun 26, 2020 @ 08:28am

Yes!

In FoxinCloud V 2.31.0-beta.4, just added xxxServer.lBSnotifyAdd to load Bootstrap Notify and Animate.css automatically.

Credits to you for discovering this utility!

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jun 26, 2020 @ 08:33am

Maybe a track for wWait ?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Jun 26, 2020 @ 12:37pm

Thierry!

Great! Speechless! Thank you!

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jun 26, 2020 @ 02:04pm

À wait message needs be triggered on server side; let me think about it.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Aug 7, 2020 @ 11:52pm

Hi Thierry,

In FoxinCloud V 2.31.0-beta.4, just added xxxServer.lBSnotifyAdd to load Bootstrap Notify and Animate.css automatically

Enjoy to see your beta.4 comming ...

Is animate.css included ?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Aug 8, 2020 @ 07:19am

Hi Vincent,

Yes, animate.css ships with this release

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Oct 3, 2020 @ 01:51am

Hi Thierry,

I find this message.
Do you plan to implement something for wWait the way you did for offline PDF printing ?

Have a good week-end

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Oct 4, 2020 @ 01:45am

wWait() executes on the server, can't send anything to the client until the request is finished, so it's useless because the user sees the 'wait' message when the long request is over.

can you provide a sample use case where emulating wWait() would be useful?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Oct 4, 2020 @ 02:09am

Yes of course.
I run a fairly long process and ask the user to wait.
Schematically:

Click () =>

  1. Message of patience
  2. Long treatment ... The end of processing does not necessarily have to be intercepted (a "hide notify" would suffice)

Thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Oct 5, 2020 @ 06:21am

If you use a FoxInCloud event method, please note that, by design similar to the VFP event model, the user won't be able to issue another action on the form until the looong request is over.

Conversely, if you use an event separate and independent from the form (as I earlier proposed to Arcadio), the user can continue working on the form while the looong request is being processed by the server.

Here is a sample code you can try:

modify file xxx.js

FoxInCloud.AjaxComplete_ = function(jqXHR, statusText){
 if (this.oNotify) {
  this.oNotify.close();
  this.oNotify = null;
 }
}
procedure cmd.click
if thisForm.wlHTMLgen
  local cJS
  text to cJS …
    FoxInCloud.oNotify = jQuery.notify(…);
    FoxInCloud.DOMEvent(undefined, false, event);
  endtext
  return m.cJS
endif

&& loooong process
Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Oct 6, 2020 @ 01:05am

Thank you Thierry, for the code and for the explanation.
I did not succeed but will try again later and will keep you informed of course.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Tore Bleken
  Vincent H.
  Oct 6, 2020 @ 01:13am

For very long reports, I suggest that you run the report in another VFP session, and let that session send it as an email after it's finished.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Oct 6, 2020 @ 02:44am

What does not succeed? JS error?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  Tore Bleken
  Oct 6, 2020 @ 06:42am

Yes thanks.
But in fact, I bounce back from the question because my problem is to send a message of patience before a long treatment.

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Tore Bleken
  Vincent H.
  Oct 6, 2020 @ 07:57am

I have used the solution I suggested, for many, many years now. My customers are very happy with it since it means that they don't have to wait at all. Also remember that the email may also contain links and other things.

Maybe it's time to rethink your strategy?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Vincent H.
  FoxInCloud Support - Thierry N.
  Oct 7, 2020 @ 12:02am

It works great, thanks !

At the click() of a button.

I had tried in the valid() of a dropdown button, and there the message does not appear (the loooong code is executed well).

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  FoxInCloud Support - Thierry N.
  Vincent H.
  Oct 8, 2020 @ 01:45am

the message does not appear

check the selector you give to jQuery.notify

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  FoxInCloud Support - Thierry N.
  Oct 8, 2020 @ 04:57am

Hi Thierry,

Then you can make this example available in the Live Tutorial?

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Tuvia Vinitsky
  Arcadio Bianco
  Oct 8, 2020 @ 08:06am

FWIW, I have a different approach to this. I have a service running on the server that monitors a table looking for new reports t create. When I need a report, I pass the report info to the service. If I want to monitor the progress, I then open a form with a timer, and the timer checks the status of the designated report. This way any FiC or VFP apps can all use the same approach

Gravatar is a globally recognized avatar based on your email address. re: Heavy Report
  Arcadio Bianco
  Tuvia Vinitsky
  Oct 8, 2020 @ 01:28pm

Hello Tuvia,

I have something similar to report patient exam results for my application, I didn't think of creating this for all reports, but it can be a way out.

© 1996-2024