Easy to Create, Easy to Change - Easy to use!


setvalue getvalue


Started by Simon B
Search
You will need to Sign In to be able to add or comment on the forum!

setvalue getvalue

Following on from the 'Reporter' thread, which has gone haywire and is putting latest replies not at the bottom but in the middle of the thread!  I figured I'd start a new thread.

I'm now having to learn QBM and ditch DQL as dataease no longer support dql reports.  I can now create a simple list records using QBM :)

Now I want to add a filter, as in report not all records, but only those between datea to dateb.

Adrian pointed my towards setvalue and getvalue.  All seems straigtht forward but at present I can not get datease 8.2 to hold anything using setvalue. My QBM reports kept coming up blank using the getvalue date ranges stored using setvalue.  So to see what was going on I used (da da daaaaa) DQL to prove my data was being stored in setvalue as I expected:  I replaced the data entry field getting the data withj a fixed value; 28/01/14, so i knew there was no issue wih the data entry field.

define "t" number .
t := setvalue ( "DateFrom" , "28/01/14" ) .
message getvalue("DateFrom") window .

And I get a blank box pop up, not a popup showing 28/01/14.

define "t" number .
t := setvalue ( "DateFrom" , "28/01/14" ) .
list records getvalue("DateFrom") .

Also returns blank, not listing a 1 line containing the text 28/01/14

As I can't get setvalue to work this is why my QBM with getvalue isn't working.  I have looked for instructions on usage but all I can find seems to show i'm doing it correct.  What's wrong?

.

Written by Simon B 09/09/14 at 15:31:40 Dataease [{8}]FIVE

Re:setvalue getvalue

The initial problem is that you have been advised to use the wrong function.If i am not mistaken Adrian took this from the top of his head and mixed them up. The format is the same but they do very different things.

 SetValue() and GetValue() are GUI functions i.e. they set and read the value from a FIELD in a form. These functions are particularly useful in ExecDQL where you have the context of the form you are calling from.

As you are going to transfer global variables the internal function in DE8 is SetVar() and GetVar().

DataEase 8 support DQL reporting as well or even better than previous versions of DFW, but the problem is that the DQL model correspond very badly with the GUI model so to maintain your layout can become awkward. This is why you traditionally have had to re-layout the DQL after changes in the DQL etc. 

In DE82 we have changed this so the designer is the "owner" of the Layout, but it has it's own side effects. If you know what you do it is much faster and easier than before, but as you don't get automatic update of the DQL layout you can get objects which is no longer attached to the DQL. Especially if you start grouping etc in the DQL.

Written by DataEase Tech Sup 09/09/14 at 15:55:42 Dataease [{8}]FIVE

Re:Re:setvalue getvalue

Ahaaaaaaa! it worked! :D

Smug look for doing a qbm that works.  Only taken me 20 years ... :D  Soooooo, I can now do a report using qbm and a dql for the data entry form to get the variables (an entered start and end date for the report).

I've experimented running the qbm without the dql after runnig it the 1st time. to see exactly what happens to the stored global variables when a report is finished, and as Adrian said it remembered them, definitely useful for passing dates on to additional reports if needed so that has potential :)

And after trying to get my head around how to reuse the seeding entry form I sussed it.  A button on my main menu with the action Execute Function/Derivtion.

The derivation: SetVar("report_type","REPORT dnote") + OpenProcedure("DELIVERY NOTE REPORT TEST DE" ) .

and then in the DQL used to seed values and to call the report, I changing the hard coded

t := documentopen ( "REPORT dnote" ) .

to

t:= documentopen (GetVar("report_type")) .

and it worked! :o  I can now reuse that entry seeding form and store a different report in variable report_type simply when a user clicks a different button for a different report.  Rather surprised myself as that's a lot of new stuff I seem to have worked out!

Big thanks to Adrian Jones who has given me the direction I needed with his example.  Much much appreciated, for the first time in 20 years I GET Qbm, and can see how to save a lot of work duplicating entry forms over and over.  There is finally light at the end of the tunnel and it's not a train for once, it3's Adrian with a torch!!

Written by Simon B 10/09/14 at 08:25:12 Dataease [{8}]FIVE