In crosstab report there any possibility to give custom view values for one row, which contains the Quarterly cost for one product in demo project.
Thank you!
In crosstab report there any possibility to give custom view values for one row, which contains the Quarterly cost for one product in demo project.
Thank you!
Again, you may use Cell_Rendered server event to set your own ViewValue. (You need to calculate the custom value yourself.)
I don't know how to use Cell_rendered() for that.
i give one example in demo project of phpmaker ,
there have category, Product, Quarterly report Okay, Now i want to give custom value for that particular category and that particular product quarterly sales costs .
I don't know how to do that if give any example i can get some idea about that.
Thanks.
If you click that link that will refer to Cell_Rendered server event, then you will see an Example code there.
As you can see, that event has $ViewValue
param, that you can use to change the view value of the cell.
Always try it by yourself first, and you may post your code for more discussion.
My Code :
public function cellRendered(&$Field, $CurrentValue, &$ViewValue, &$ViewAttrs, &$CellAttrs, &$HrefValue, &$LinkAttrs)
{
if (isset($Field->Records[9])) {
$desiredArray = $Field->Records[9];
$projectId = $desiredArray["PROJECT_ID"];
$pSort = $desiredArray["P_SORT"];
echo $projectId;
} else {
echo "Key '9' does not exist in the array.";
}
}
OutPut :
Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. Key '9' does not exist in the array. A-PEU0530 A-PEU0530 A-PEU0530
Then how to fetch that project id without these error's.
My code:
if (isset($Field->Records[9])) {
$prj_id_array = $Field->Records[9];
$projectId = $prj_id_array["PROJECT_ID"];
$pSort = $prj_id_array["P_SORT"];
$len = count($this->Columns) - 1;
for ($i = 1; $i <= $len; $i++)
{
if (isset($this->Columns[$i]))
{
$mon_array = $this->Columns[$i]->Value;
$query = ExecuteScalar("SELECT MAX(`Last in date`) AS 'Maximum Last in date' FROM (SELECT GREATEST(COALESCE(REVISED_ETA1, '1900-01-01'), COALESCE(REVISED_ETA2, '1900-01-01')) AS 'Last in date' FROM por_electronics_tracker WHERE (por_electronics_tracker.PRQ_STATUS = 'A' OR por_electronics_tracker.PRQ_STATUS = 'C') AND por_electronics_tracker.STATUS IN (6,11) AND PROJECT_ID ='".$projectId."' AND YEAR(por_electronics_tracker.PRQ_APPROVED_DATE) = 2023 AND MONTH(por_electronics_tracker.PRQ_APPROVED_DATE) = '$mon_array') AS LID");
var_dump($query);
}
}
}
i want that query result should reflect in $Field->Records[9]
row data.
Give me any suggestions. Please
Thanks!
In crosstab report how to change dynamically a particular cell value which is summary values cell. And how to get that particular cell value's column name or value?
In my case i have created one crosstab report that have project_id, process, m_sort and count. m_sort is the dynamic column. ( project_id and process is row heading)
Now what i am trying to do is :
1.in that process field have 10 processes for each project. In the 10 th process i want show a estimation date for each dynamic columns instead of summary values.
2.To get thet estimation date i need that project_id and dynamic column values to fetch from database.
These are the requirement.
Please help me out on this.
Thank You!
mobhar wrote:
If you click that link that will refer to Cell_Rendered server event, then you will see an Example code there.
As you can see, that event has
$ViewValue
param, that you can use to change the view value of the cell.Always try it by yourself first, and you may post your code for more discussion.