Solved

Urgent about exprestion in grid datawindow

Posted on 2004-04-05
15
431 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
  • 3
  • 3
  • 3
  • +2
15 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 5

Expert Comment

by:berXpert
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 15

Expert Comment

by:namasi_navaretnam
Comment Utility
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
Comment Utility
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
Comment Utility
Please post your code/Datwinsow .srd
--Vikas
0
 

Author Comment

by:sohaj
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now