Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session or global vars in reports #252

Open
fra81 opened this issue Jul 20, 2017 · 2 comments
Open

Session or global vars in reports #252

fra81 opened this issue Jul 20, 2017 · 2 comments

Comments

@fra81
Copy link

fra81 commented Jul 20, 2017

Hi, is possible in some way to use session or global var in report? Example inserting the user id currently logged in a query (when embedding in a third application).

Thank you

@davidmichaelakers
Copy link

I created something that will do this. #230

@fra81
Copy link
Author

fra81 commented Jul 24, 2017

Ok, thanks it works!
I notice that if the DYNAMIC is set before the first VARIABLE (in fact as first item after the title etc) in the .sql report, I get this error

PHP Fatal error: Uncaught exception 'Exception' with message 'Unknown header 'VARIABLE' - xx/xyz.sql' in lib\PhpReports\Report.php:232
Stack trace:
#0 classes\headers\DynamicHeader.php(36): Report->parseHeader('VARIABLE', Array)
#1 lib\PhpReports\HeaderBase.php(31): DynamicHeader::init(Array, Object(Report))
#2 lib\PhpReports\Report.php(228): HeaderBase::parse('Dynamic', '{\nfile: "tg_glo...', Object(Report))
#3 lib\PhpReports\Report.php(190): Report->parseHeader('Dynamic', '{\nfile: "tg_glo...')
#4 lib\PhpReports\Report.php(47): Report->parseHeaders()
#5 lib\PhpReports\PhpReports.php(389): Report->__construct('xxx/xyz...')
#6 lib\PhpRepor in lib\PhpReports\Report.php on line 232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants