Solved

Urgent about exprestion in grid datawindow

Posted on 2004-04-05
15
436 Views
Last Modified: 2013-12-26
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
Comment
Question by:sohaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +2
15 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10756699
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
 

Author Comment

by:sohaj
ID: 10758386
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
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10760107
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:berXpert
ID: 10761025
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
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10761517
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
 

Author Comment

by:sohaj
ID: 10762870
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
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10763010
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 10763268
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
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10763629
Please post your code/Datwinsow .srd
--Vikas
0
 

Author Comment

by:sohaj
ID: 10771914
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
 
LVL 18

Accepted Solution

by:
diasroshan earned 125 total points
ID: 10772172
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 12300697
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question