Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

Urgent about exprestion in grid datawindow

Hellow Every body ...
I have datawindow of type Grid,and I have some columns to be visible or not as folowing ,
column name"security" which contain integer value
Column to use exprestion (subject)
exprestion in visible property is:
 gs_security[security] where gs_security is global variable of type integer array.
on development time it work perfectly ,But the problem when I make exe file and I run it ,its not working!!!
Any help please
its urgent.
thanks
0
sohaj
Asked:
sohaj
  • 3
  • 3
  • 3
  • +2
1 Solution
 
namasi_navaretnamCommented:
What version of PB? How do you populate this gs_security array.? Any dw involved? You may need to create a PBR file to include dws that dynamically referenced.

Search for *.pbr on your file system to see some sample pbr files.
Sample entry.
pfcwnsrv.pbl(d_toolbars)

regards-
0
 
sohajAuthor Commented:
I use PB 8 ,and I already included all dynamic datawindows in the pbr file.I don't understand what you mean by population of gs_security.
regards
0
 
Vikas_DixitCommented:
It is not working ? does it give you any error, or It just does not work as expected......?
Population of gs_security means when and how are you assigning the values to the members of this array?? at the time of declaring the array, or somewhere in the script..
Also, try using a function instead, that will return required true/false values:

integer f_isVisible(integer ai_security) :
integer li_aSecurity[] = {1,0,......}
return li_aSecurity[ai_security]

And use this function in the visible expression... and see if it works.....

-Vikas
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
berXpertCommented:
Hi sohaj,

Can you post how and where did you declare gs_security ?

Can you post your "visible" expression of "subject" column?

This is because I don't think you are using a global variable in that expression, I mean you can't use a global variable because it gives you an error like "Expression is not valid" or "Expecting TRUE/FALSE expression".

And this give me my new question, why do you said it works on development time?

You need to build a function using your global variable to get what you are expecting as -Vikas said.

BerX
0
 
namasi_navaretnamCommented:
Are you using the security application that comes with 8.0? To build that security app, you will need to include pfcsecsc.pbr within your project.

pfcsecsc.pbl(d_pfcsecurity_applookup)
pfcsecsc.pbl(d_pfcsecurity_controllist)
pfcsecsc.pbl(d_pfcsecurity_grouplookup)
pfcsecsc.pbl(d_pfcsecurity_groupverify)
pfcsecsc.pbl(d_pfcsecurity_templateupdate)
pfcsecsc.pbl(d_pfcsecurity_userlookup)

Also, Have you added the pbr files for each pfc pbls in your project.
pfcapsrv.pbr
pfcdwsrv.pbr
pfcmain.pbr
pfcutil.pbr
pfcwnsrv.pbl

regards-
0
 
sohajAuthor Commented:
Thanks for all,
In my exprestion ,I used function called f_security.In this function I take integer argument which is security column in the datawindow ,and its return an integer value 1 or 0 to use it in my exprestion .I declare gs_security array and its value once application started before any retrieving data.I think the problem happend becuse the function in exprestion does not take the value of security column even I put in visible expestion of subject column the following "f_security(security)". I dont know How I can solve this problem.
Regards
0
 
namasi_navaretnamCommented:
If works within development environment, I am not why it is not working as a exe. I think it is a data issue OR a datawindow is missing in the pbr file. Perhaps you can run the exe with /pbdubug option and see if you get the correct values populated. Or compile your application with some messageboxs that display the data of interest.

Could you post your f_security function?


regards-
0
 
diasroshanCommented:
hi sohaj,
u need to elaborate a bit more on ur question... don't understand why u need an array variable... in any case, u have written u populate the array before retrieving any data....
...how will u get the value of the field 'security' if no data is retrieved...

Nevertheless..here's an example which might help ..

i have a datawindow which has some columns ..2 of them being security(numeric (5)) and subject...

i have a function f_security(integer).. ie i pass an integer value and it returns an integer...

the code is as follows...
Return arg_security  // arg_security is the passed value which is either 1 or, 0...

now in my application open .. i first retrieve the datawindow and in the visible property of  subject write the following.... f_security(security)   /// security is my dw column which is either 1 or 0

depending on what this function returns 1 or 0 'subject' column gets visible or invisible...

it works fine with an exe...

...let me know why u need a global array variable...

Cheers,
Rosh
0
 
Vikas_DixitCommented:
Please post your code/Datwinsow .srd
--Vikas
0
 
sohajAuthor Commented:
I 'am using array to store some values depend on user who logged on.Valuse only can be 0 or 1 ,and I take these valuse once application started .Let say
gs_securtiy[1]=1
gs_securtiy[2]=0
gs_securtiy[3]=0
gs_securtiy[4]=1
.
.

gs_securtiy[n]=1
and I have table named Document ,one of its columns is "security" which contain an integer value added at the time of insertion.Now in my datawindow which come from document table ,I have "subject" column ,and I want to show or hide this column depend on the value of security column as follows:
if gs_secrity[security]=1 then subject visible ,else not visible.
I'am using function f_security in visible property in subject column which take the value of "security" column and return only 0 or 1.
my problem still .its work fine at run time .but at exe not
Regards
0
 
diasroshanCommented:
hi sohaj,

i have often encountered problems with functions when they seize to fire.... but it usually happens at runtime and works fine after regenerating them....and in exes....

Anyways.. what i can offer is a simple workaround...hope it helps...
The code goes as follows...

// Assign values to ur variable....
gs_security[1] = 0
gs_security[2] = 1
gs_security[3] = 0
gs_security[4] = 1
gs_security[5] = 0
gs_security[6] = 1

// what u need to do is add a computed column...(not field)... eg. result ...[0 as result]
// this column will store ur gs_security integer based on ur security field
// add the following code after ur dw is retrieved....

Long i , ll_res

For i = 1 to dw_1.Rowcount()
      ll_res = dw_1.object.security[i]
      If Isnull(ll_res) Then Continue
      dw_1.object.result[i] = gs_security[ll_res]
Next      

dw_1.Object.subject.Visible="0~tIf(result=0,0,1)"

This will certainly serve ur purpose...

Cheers,
Rosh
0
 
diasroshanCommented:
Hi Venabili,
looks like sohaj got his problem solved after my last comment hence he didn't find a need to come back....

so please do the needful...

any other comments welcome...

Cheers,
Rosh
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now