Page 1 of 2
Cannot print passed parameter value
Posted: Tue Jan 15, 2019 1:05 am
by gegar
Hello
I can made this and is working-> SELECT * FROM {Variable1}
But I want to print or view in text expresion {Variable1} not working?
Expression in Text property of 'Text1' can't be evaluated! [object Object]
Why?
Thank you for you answer.
Re: Cannot print passed parameter value
Posted: Tue Jan 15, 2019 5:39 am
by HighAley
Hello.
It should work right.
Could you send us a sample report template?
Thank you.
Re: Cannot print passed parameter value
Posted: Tue Jan 15, 2019 4:23 pm
by gegar
Hello
I have the filter for the database in $_SESSION["variable1"] the name for the company in $_SESSION["company"]
In handler.php I set the values to
$event->parameters["variable1"] = $_SESSION["variable1"];
$event->parameters["company"] = $_SESSION["company"];
I work with SELECT * FROM table WHERE {Variable1} is OK
But the header Band, i want to see the name of Company, Address and other values.
I have a field, ExpressionText {company}
I think those parameters are only for the data sources and if so, where I configure so that I can take them as a field for the header band.
Thank you.
Re: Cannot print passed parameter value
Posted: Tue Jan 15, 2019 10:59 pm
by Lech Kulikowski
Hello,
Please send us your report for analysis
Thank you.
Re: Cannot print passed parameter value
Posted: Wed Jan 16, 2019 4:32 am
by gegar
Hello
Here my report
Table
DROP TABLE IF EXISTS `trademarks`;
CREATE TABLE IF NOT EXISTS `trademarks` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Trademark` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `trademarks`
--
INSERT INTO `trademarks` (`ID`, `Trademark`) VALUES
(1, 'BMW'),
(2, 'Cadillac'),
(3, 'Dodge'),
(4, 'Ford'),
(5, 'GMC'),
(6, 'Jaguar'),
(7, 'Lexus'),
(8, 'Mercedes-Benz'),
(9, 'Nissan'),
(10, 'Rolls-Royce'),
(11, 'Toyota');
COMMIT;
*************************************
handler.php
/// Filter only by Ford is working
$event->parameters["Variable1"] = "'Ford'";
/// Company Name
$event->parameters["Company"] = "'Company Ford'";
Thank you.
Re: Cannot print passed parameter value
Posted: Wed Jan 16, 2019 7:42 am
by Lech Kulikowski
Hello,
Please try to add your Company variable to the dictionary.
Thank you.
Re: Cannot print passed parameter value
Posted: Wed Jan 16, 2019 2:35 pm
by gegar
Hello
I don't understand.
I tried the following:
1- In report design, I made new variable
Name: Ncomp
Init: Expresion
Expression: {Company}
It does not work.
My new question too is, How I see my Filter in my Report.
I want to see in the header.
Trademark Filter: Ford <--{Variable1} Company : Company Ford <--{Company}
Can you please explain in more detail an example if possible.
Thank you
Re: Cannot print passed parameter value
Posted: Thu Jan 17, 2019 2:23 am
by gegar
Hello
I have it. The partial solucion is:
In desing create the variable with same name company
The attachment variable.jpg is no longer available
And put the next code in viewer.php and designer.php
// Load and show report
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("localization/en.xml", true);
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/reportname.mrt");
/// New Code for update company variables
report.dictionary.variables.getByName("company").valueObject="Company 123";
viewer.report = report;
And that is, the variable is ready for the report.

- Variable Company
- variable.jpg (53.38 KiB) Viewed 16309 times
Thank you.
Re: Cannot print passed parameter value
Posted: Thu Jan 17, 2019 11:35 am
by Lech Kulikowski
Hello
We are always glad to help you!
Thank you.
Re: Cannot print passed parameter value
Posted: Thu Jan 17, 2019 1:07 pm
by gegar
New Question????
Now I want to create the new variable for code: ????
This solution not work.
// Load and show report
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("localization/en.xml", true);
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/report.mrt");
report.dictionary.variables.getByName("company").valueObject="Company 123";
// New variable Address
var variables = new Stimulsoft.Report.Dictionary.StiVariable();
variables.name = "Address";
variables.alias = "Address";
variables.type = Stimulsoft.System.StimulsoftStringList;
variables.requestFromUser = false;
variables.value = "123456789";
viewer.report = report;
viewtopic.php?f=18&t=56088&p=149110&hil ... de#p149110
Where I find the complete code to create it by php, I have tried some solutions but they do not work???
Someone have the code for create variable in .
Thanks.