custom function view in js viewer
custom function view in js viewer
my desired custom function work and showed result in designer preview but not shown result in browser
whats wrong
whats wrong
Re: custom function view in js viewer
Hello,
Please elaborate your request?
Thank you.
Please elaborate your request?
Thank you.
Re: custom function view in js viewer
thank you for reply
I have 2 function in my report file one of them is built in function and another is my custom function I can see the out put of both function in preview page of my designer but when i want use the report in php js viewer, built in function shown but my custom function not shown
you can find my files in attachments
thanks in advance.
I have 2 function in my report file one of them is built in function and another is my custom function I can see the out put of both function in preview page of my designer but when i want use the report in php js viewer, built in function shown but my custom function not shown
you can find my files in attachments
thanks in advance.
- Attachments
-
- 2.jpg (64.92 KiB) Viewed 4900 times
-
- 1.jpg (59.38 KiB) Viewed 4900 times
-
- report.zip
- (1.79 MiB) Downloaded 232 times
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: custom function view in js viewer
Hello,
Your function is added on the Code tab. In the PHP, JS version, code in events and Code tab is not supported.
You can add own function only from code:
https://stimulsoft.zendesk.com/hc/en-us ... JavaScript
Thank you.
Your function is added on the Code tab. In the PHP, JS version, code in events and Code tab is not supported.
You can add own function only from code:
https://stimulsoft.zendesk.com/hc/en-us ... JavaScript
Thank you.
Re: custom function view in js viewer
Dear lech kulikowskiLech Kulikowski wrote: ↑Thu Jan 17, 2019 11:29 am Hello,
Your function is added on the Code tab. In the PHP, JS version, code in events and Code tab is not supported.
You can add own function only from code:
https://stimulsoft.zendesk.com/hc/en-us ... JavaScript
Thank you.
thanks for your reply as I'm new in stimulsoft may I ask please give me a sample of using my own function in the php, js version.
I could not understand from the link that you send.
thanks in advance
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: custom function view in js viewer
Hello,
You should add your function in your web project code. Samples for JS, PHP you can find at the following link:
https://github.com/stimulsoft/Samples-JS-PHP
Thank you.
You should add your function in your web project code. Samples for JS, PHP you can find at the following link:
https://github.com/stimulsoft/Samples-JS-PHP
Thank you.
Re: custom function view in js viewer
Hello
My solution is:
The function is for example:
The file function.js or save your function in this file.
var function1 = function (checklist, state) {
var result = "9867";
return result;
}
var function2 = function (sender, value) {
if (value == 'S') {
greeting = "Good morning";
} else if (value == 'N') {
greeting = "Good day";
} else {
greeting = "Good evening";
}
return greeting;
}
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("Test", "Test", "checklistFunction", "", "", String, "", [String, String], [""], [""], function1);
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("Test", "Test", "checklistFunctionDrill", "", "", String, "", [Stimulsoft.Report.Components.StiText, String], [""], [""], function2);
Stimulsoft.Report
.Dictionary
.StiFunctions
.addFunction('Test', 'Test', 'TestFunc', 'Function', Stimulsoft.System.Int32, Stimulsoft.System.Int32,
'Function',[Stimulsoft.System.Int32], ['i'], [''],function(i){
return 123;
});
In the files designer.php and viewer.php add the next code after report.loadFile.
</script>
<script src="Y-functions.js" type="text/javascript"></script>
<script type="text/javascript">
That is all.
My solution is:
The function is for example:
The file function.js or save your function in this file.
var function1 = function (checklist, state) {
var result = "9867";
return result;
}
var function2 = function (sender, value) {
if (value == 'S') {
greeting = "Good morning";
} else if (value == 'N') {
greeting = "Good day";
} else {
greeting = "Good evening";
}
return greeting;
}
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("Test", "Test", "checklistFunction", "", "", String, "", [String, String], [""], [""], function1);
Stimulsoft.Report.Dictionary.StiFunctions.addFunction("Test", "Test", "checklistFunctionDrill", "", "", String, "", [Stimulsoft.Report.Components.StiText, String], [""], [""], function2);
Stimulsoft.Report
.Dictionary
.StiFunctions
.addFunction('Test', 'Test', 'TestFunc', 'Function', Stimulsoft.System.Int32, Stimulsoft.System.Int32,
'Function',[Stimulsoft.System.Int32], ['i'], [''],function(i){
return 123;
});
In the files designer.php and viewer.php add the next code after report.loadFile.
</script>
<script src="Y-functions.js" type="text/javascript"></script>
<script type="text/javascript">
That is all.
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: custom function view in js viewer
Hello,
Thank you for the provided solution.
Thank you for the provided solution.