Skip to content

Instant AJAX Report Generation in MerciGlobal Cloud ERP

MerciGlobal Cloud ERP introduces a seamless and faster method for executing reports using AJAX technology. This improvement dramatically enhances the user experience by removing the need for full-page reloads and enabling dynamic interaction with report criteria forms.

🚀 What Changed?

In the past, report execution involved a full-page submission, resulting in slower performance and less responsive interfaces. With the new implementation:

  • Reports are fetched asynchronously.
  • Criteria forms appear instantly without page reloads.
  • User productivity improves with faster response times.

🔄 Old PHP Implementation

$url = addrApi() . 'z_rep_recpayint1.php';
$form->addButton('submit', 'Generate Report', 'Generate Report', $url);

Behavior: Submits the form and reloads the entire page.


⚡ New AJAX-Based Implementation

$url = addrApi() . 'z_rep_recpayint1.php';
$form->addJSButton('Save', 'Generate', 'Generate', true, "callRep('$url')", true);

Behavior:

  • Creates a JavaScript-enabled button that triggers callRep().
  • Executes the report using an AJAX call, dynamically fetching the results.

🛠️ Changes in the Target Report File

Update the report rendering function to work with AJAX:

Old Code:

$form->render();

New Code:

$form->renderForm();

This ensures only the form portion is rendered, making it compatible with AJAX content injection.


🎯 Resulting UX Improvement

Once the report is generated, users can instantly access the criteria form again via a styled tab interface:

Criteria Tab


💡 Summary

Feature Old Behavior New Behavior
Report Trigger Full page reload AJAX-based call
Form Rendering $form->render() $form->renderForm()

By leveraging AJAX in MerciGlobal Cloud ERP, users and developers gain a faster, more seamless reporting experience. This modern approach is ideal for enterprise users demanding real-time insights with minimal interaction delays.