I broke the report into two reports that get run separately. When I first run the nexus report for whatever taxyear, it seems to work fine. But when I try to change the taxyear by choosing a different year and then pressing "change taxyear", the screen does blink (like it is refreshing) but doesn't seem to fill in the table. But now if then press the browser refresh, it populates fine. Here is the form code to change the tax year:
<?php
if (isset($_POST['taxyear']))
$_SESSION['last_TY']=$_POST['taxyear'];
?>
<?php
echo "<br><br><br><br><br><br><h3>Nexus Report for: ".$_SESSION['campaign']." for tax year ended ".$_SESSION['last_TY'];
?>
Here is the section I am talking about
When I first try to run the report from the main menu, the .view runs and the results are OK. But when I change the taxyear (from the code above), the .view runs again. The same code runs again, but with a different taxyear. Here is the code:
Table::create(array(
"dataStore"=>$this->dataStore("BPlt_BC")->filter("taxyear","=",$_SESSION['last_TY']),
"showFooter"=>true,
"grouping"=>array(
"item"=>array(
"calculate"=>array(
"{sumAmount}"=>array("sum","dollarsPerBC"),
),
"cssStyle"=>"text-align:right",
"bottom"=>"<td colspan='6 style='text-align: right'><b>Total qualified wages for : {item}</b></td><td style='text-align: right'><b>{sumAmount}</b></td><br>",
),
),
"showFooter"=>"bottom",
"columns"=>array(
"item"=>array("label"=>"Business Component"),
"employee",
"employee_email",
"title",
"role",
"qualified_dollars"=>array(
"label"=>"Qualified Wages",
"cssStyle"=>"text-align:right",
),
"dollarsPerBC"=>array(
"label"=>"dollars",
"cssStyle"=>"text-align:right",
"prefix"=>"$",
"footer"=>"sum",
"footerText"=>"<b>Total Qualified Wages for all Business Components:</b> @value")
),
"cssClass"=>array(
"table"=>"table table-bordered",
"tr"=>"row-css-class",
"th"=>"header-css-class",
"td"=>"cell-css-class",
"tf"=>"footer-cell-css-class",
)
)
);
But this time the new table does not get populated. But if I press the Browser refresh I get this popup:
and if I hit "continue", the .view runs again, and now the table is fully populated. So something about pressing the browser refresh makes it work! So how do I get the "form resubmission" to fire wo user intervention?