on 08-25-2020 6:23 AM
Hi
How to display selected values from Multi Value parameter in Report Header
This is parameter
ItmGroup@Select * from OITB
Trying below but it is giving error- A string array is required here
Thanks
To show the selected values of any multi-value parameter, you would use a function like the following:
local NumberVar i;
local NumberVar itemCount := ubound({?MyParameter});
StringVar result;
if itemCount = 1 then
result := {?MyParameter}
else
for i := 1 to itemCount do
(
if i = 1 then
result :={?MyParameter}[i]
else
result := result + ", " + {?MyParameter}[i];
);
result
Since multi-value parameters are stored in an array, this will append them together with ", " between them.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dell
On below line it is giving error - a string is reqd here
result := {?ItmGroup@Select * from OITB}local NumberVar i;
local NumberVar itemCount := ubound({?ItmGroup@Select * from OITB});
StringVar result;
if itemCount = 1 then
result := {?ItmGroup@Select * from OITB}
else
for i := 1 to itemCount do
(
if i = 1 then
result :={?ItmGroup@Select * from OITB}[i]
else
result := result + ", " + {?ItmGroup@Select * from OITB}[i];
);
result
<br>
Secondly can u pls guide me how this token parameter works - ItmGroup@Select * from OITB
Try taking out the "if...else" part of the formula (three lines above the "for" loop).
Since you have the parameter in this format, I'm going to assume that you're working with B1. I haven't worked much with B1, but I believe that after you publish your report to B1, this parameter name format tells B1 where to get the lookup data for the parameter list of values so that it will show the list for the user to select from.
-Dell
Hi Dell
It is working . But is shows values as 1110.00 , 1210.00
I dont want .00 . it should display as only 1110,1210
local NumberVar i;
local NumberVar itemCount := ubound({?ItmGroup@Select * from OITB});
StringVar result;
for i := 1 to itemCount do
(
if i = 1 then
result :=Cstr({?ItmGroup@Select * from OITB}[i])
else
result := result + ", " + Cstr({?ItmGroup@Select * from OITB}[i]);
);
result
This is because using CStr without any additional parameters gives you the default number format. So, you need to change your calls to CStr to format the number. It will look something like this:
Cstr({?ItmGroup@Select * from OITB}[i], 0, "", "")
The "0" tells it to have no decimal places, the first empty string tells it to not include a thousands separator, and the second empty string tells it to no have any decimal separator.
-Dell
my last reply for this..can you share our procedure/Query
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please share the example for understanding your requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.