[SOLVED] Â Show calculated fields on chart page |
2/14/2017 4:08:24 AM |
PHPRunner General questions | |
![]() Hi all, |
|
![]() |
Admin 2/14/2017 |
The chart itself is not designed to display anything but charts. Your best bet probably is to add a code snippet to chart page in Visual Editor, perform calculations there and display results on the page. |
![]() |
scottyrussell author 2/14/2017 |
Thanks Sergey, I thought code snippets were the way to go. |
![]() |
Admin 2/15/2017 |
There is no current record on chart page, charts normally work with multiple records or even with aggregated results. You cannot use getCurrentRecord() there. |
![]() |
lefty 2/15/2017 |
The chart itself is not designed to display anything but charts. Your best bet probably is to add a code snippet to chart page in Visual Editor, perform calculations there and display results on the page.
|
![]() |
scottyrussell author 2/15/2017 |
There is no current record on chart page, charts normally work with multiple records or even with aggregated results. You cannot use getCurrentRecord() there. Your best bet is to execute the same SQL Query in your code snippet that you use to populate chart, and do something with that data this query returns.
global $strTableName;
dbo.mrwin_s01_sow_cc.calc_value_s01_cc = '".$_SESSION['calc_value_s01_cc']."'
|
![]() |
lefty 2/16/2017 |
Hi Sergey, I am going down the SQL query path (I have to get use the search variables form over 40 dropdowns!! accessing multiple tables), in a previous project I was able to grab a search variable to display by using a Before Display event (Jane hooked me up with some prime code when a couple of years ago! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81357&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> similar to this example in the manual). So I decided to recycle this code to test using just a few variables: global $strTableName;
dbo.mrwin_s01_sow_cc.calc_value_s01_cc = '".$_SESSION['calc_value_s01_cc']."'
|
![]() |
scottyrussell author 2/16/2017 |
Awesome!!!! thanks John, those quotes are confusing!! that sorted out the Numerical/varchar error now I am getting another error dbo.mrwin_sla_reliability_cc.value_num = ".$_SESSION['value_num3'].""); |
![]() |
lefty 2/16/2017 |
Awesome!!!! thanks John, those quotes are confusing!! that sorted out the Numerical/varchar error now I am getting another error Error type 256 Error description Source: Microsoft SQL Server Native Client 11.0 Description: Incorrect syntax near the keyword 'AND'. I can't see anything wrong with the query syntax and am trying to work this out now, do you have any ideas? It is saying the problem is with the last line of the query dbo.mrwin_sla_reliability_cc.value_num = ".$_SESSION['value_num3']."");
|
![]() |
scottyrussell author 2/16/2017 |
dbo.mrwin_sla_reliability_cc.value_num = ".$_SESSION["value_num3"]."
|
![]() |
scottyrussell author 2/16/2017 |
To simplify things I reduced the code to this: global $strTableName;
".$_SESSION['calc_value_s01_cc']."
|
![]() |
Admin 2/21/2017 |
This problem is specific to your code. Instead of executing SQL query print it on the page and see what is missing. |
![]() |
scottyrussell author 2/21/2017 |
Thanks Sergey, I got back into this today creating a test set of data and using the debugging tools.
|
![]() |
lefty 2/22/2017 |
Thanks Sergey, I got back into this today creating a test set of data and using the debugging tools. Here's my current code
|
![]() |
scottyrussell author 2/22/2017 |
Hi John, |
![]() |
scottyrussell author 2/22/2017 |
All righty!! I've worked it out!!
|