|
Calc Builder SupportCalc Builder support |
| Public write access is disabled. Please login |
![]() | Last post |
![]() ritchg 6 posts --- |
22.12.2011 18:38Variable passing to PDF, email and ExcelI am trying to include some text with some ROI calculators to explain to the user how the calculationis done. As I cannot include text in the Calc Builder itself, I've added some PHP to the pdf creation module but I'd like to have different calculators use different explanatory text. Can I pass a variable from the calculation entry area to the pdf, Excel and email creation modules? Thanx. |
![]() MSTeam 227 posts --- |
22.12.2011 19:57 Re: Variable passing to PDF, email and Excel Hello,One quick solution maybe including in 'code' of each calculator a variable stored at user session. Then in PDF, email and csv you can get it from session again. Hope this helps, Moonsoft Team Moonsoft Team www.moonsoft.es |
![]() ritchg 6 posts --- |
23.12.2011 13:39 Re: Variable passing to PDF, email and Excel Okay - so if I include (for example)$CommentCode = 'MAIN'; in the same place as my calculation code, and then in the pdf.php file include if ($commentCode=='MAIN){ etc. I should be able to make the switch? This is what I have tried, and the variable value does appear to be available in the pdf.php file. Is there a variable scope issue I need to deal with? Or is the variable in the calculation area included in another entity that I need to access (for example, $bob.calc.CommentCode)? Thanx. |
![]() MSTeam 227 posts --- |
23.12.2011 17:14 Re: Variable passing to PDF, email and Excel Hello,yes, when handling variables through different server requests, you need to store the values in a persistent way, using 'session' variables. In Jjoomla session is supposed to work this way: Store value: $session =& JFactory::getSession(); $session->set('name', "value"); Now you can retrieve this session variable using: $session =& JFactory::getSession(); $myvar= $session->get('name'); Hope this helps, best regards Moonsoft Team Moonsoft Team www.moonsoft.es |
Pre-sales questions/Custom requests: gestion@moonsoft.es
©2012 Moonsoft Software Solutions | Designed and developed by Moonsoft