Dear All,
I have developed application for managing warehouse. It is simple in and out warehouse transaction. However, the item is about 900. The problem is when I generate monthly report, it will produce minimum 1800 rows (Initial balance and final stock). I always got reach maximum execution time. I have no idea how could I display the result on screen without reach maximum execution time.
One way that I can think of is to generate oflline into pdf/excel so that the user can see the report from a link. However, this approach has some limitation on how could I trigger the generation from web application.
Is there any yii way to do this?
Thank you in advance.
Daniel
Page 1 of 1
Handle Of Long Running Process In Yii reach maximum execution time
#2
Posted 23 January 2013 - 04:52 AM
This is a PHP or Apache configuration issue. Try this function first.
#3
Posted 23 January 2013 - 05:21 AM
I would use ajax.
Query how many results there will be then use ajax to request x amount of rows at a time.
Query how many results there will be then use ajax to request x amount of rows at a time.
#4
Posted 23 January 2013 - 09:11 AM
alex-w, on 23 January 2013 - 05:21 AM, said:
I would use ajax.
Query how many results there will be then use ajax to request x amount of rows at a time.
Query how many results there will be then use ajax to request x amount of rows at a time.
Hi,
Thank you for the great idea. However, how can I make x requests of ajax calls? I calculate that my algorithm is ok for around 50 items.
Cheers,
Daniel
#5
Posted 23 January 2013 - 10:01 AM
When the page is first requested get a count of all the rows that will be returned.
Then have an ajax request call a controller action and return 50 results.
Once this has been returned and rendered into the report request the next 50 then repeat until you have all records.
Then have an ajax request call a controller action and return 50 results.
Once this has been returned and rendered into the report request the next 50 then repeat until you have all records.
#6
Posted 24 January 2013 - 08:45 AM
Hi,
I create a CActiveForm and submit the ajax call via ajax button.
How could I iteratively submit the form (simulating ajaxButton click) ?
Cheers,
Daniel
I create a CActiveForm and submit the ajax call via ajax button.
....
<div class="actions">
<?php echo CHtml::ajaxButton('Generate', $this->createUrl('/invoice/periodeInvoicing'), array(
'type' => 'POST',
'beforeSend' => 'function(data,status){ $("#invoice_btn").attr("disabled", "disabled"); $("#invoice_btn").removeClass("primary"); }',
'success' => 'invoiceSaved'), array('id' => 'invoice_btn', 'class' => 'btn primary')); ?>
</div>
....
How could I iteratively submit the form (simulating ajaxButton click) ?
<script type="text/javascript">
function invoiceSaved(data, textStatus, XMLHttpRequest) {
$.fn.yiiGridView.update('invoice-grid');
var obj = jQuery.parseJSON(data);
jQuery('#alert').bootAlert('alert', obj.status, obj.msg);
if(obj.totInvoices <= 0) {
$('.invoice-form').hide();
} else {
$('#invoice_btn').removeAttr('disabled');
$('#invoice_btn').addClass('primary');
====> need code here to resubmit the form <=====
}
}
</script>
Cheers,
Daniel
Share this topic:
Page 1 of 1

Help












