Welcome! Log In Create A New Profile

Advanced

Hyper File View,Memory Zone or?

Posted by Paul Ziegler 
Paul Ziegler
Hyper File View,Memory Zone or?
November 06, 2008 09:57PM
I am just starting to learn how to do reports in WD. I need to present my clients with report data selections: Gender,School,Class,Program,Age,etc. Depending on what they select, I will need to get the records and sort them before I call the report. In my old design tool, I would use sets (union, intersection, etc.). What is the best way to do this in WD? Any suggestions would be appreciated.


Milton
Re: Hyper File View,Memory Zone or?
November 06, 2008 10:11PM
Hi Paul,

You can do all of this with Queries. You construct a query to join tables on common keys and also include any filters. Queries are fast and flexible and can be fed from user entered parameters.

Milton
Paul Ziegler
Re: Hyper File View,Memory Zone or?
November 06, 2008 11:48PM
Milton,

My clients will need to be able to select from 1 to say 30 different classes or other criteria. They may select 12 classes out of 30. How could I handle this with a Query?

Thanks,
Paul
Louis Verbraak
Re: Hyper File View,Memory Zone or?
November 07, 2008 08:41AM
Hello Paul,

Parameters which get the value 'Null' are ignored by the query.

HTH.
Piet van Zanten
Re: Hyper File View,Memory Zone or?
November 07, 2008 10:24AM
Hi Paul,

In case of different sorts and selections I would prefer using a report based on a memory zone. No parameters to pass to the report, just the memory zone. You control selection and sorting completely from programming.
This is a personal preference, I'm not a query wizzard, so if it get's complicated I always resort to Wlanguage coding. For the easy stuff I use queries.

Regards,
Piet
Paul Ziegler
Re: Hyper File View,Memory Zone or?
November 07, 2008 05:09PM
Thanks for all the replies. I see I can use a Query with parameters (Nulls when needed) for most of my needs. However, I will need to be able to do the following. Allow the user to select any number of names from a File Item and then I would include them in a report. Example: They select 10 different school names from a possible 20 (these numbers could be different each time).

The possiblities that I see are:

1. Create a loop for the school names selected and do a query for each school name, create Hyper File View for each query, merge the views, do a sort on the resulting view. As I read the Help, the sort of the view would not initially be an indexed sort. Is that correct?

2. Create a loop for the school names selected and do a query for each school name and add the records one by one to a Memory Zone using MemAdd. Sort the zone.

Feedback on these two possibilities is appreaciated. Also, if there is a more efficient way to accomplish this please let me know.

Thanks,
Paul
Paulo Oliveira
Re: Hyper File View,Memory Zone or?
November 07, 2008 06:03PM
I don’t know all your problems but with the described one query is the right solution (in my humble opinion) .
In the query definition, in the school code field put one condition using the “In the list” and “supplied by parameter” and before the hexecutequery put all the school codes you want in the parameter or "null" if you want all the schools.
Look in the help for hexecutequery and read the “Notes” carefully.
Paul Ziegler
Re: Hyper File View,Memory Zone or?
November 07, 2008 07:50PM
Paulo,

Thanks for the info. The In the List work great. I did not know I had that option. My old tool did not have anywhere near as many options for Queries. I more question. I am having a problem passing a null value as a variable to the Query. It works fine if I type in Null, for the paramater that I want ignored, but I need to pass it as a variable. My code is below

sSchool is string = Null

HExecuteQuery(QRY_SchoolNameTest,hQueryDefault,sSchool,"Smith")
iPreview(i100, "Pint preview", True)
iPrintReport(RPT_SchoolNameTest)

Thanks,
Paul
Arie
Re: Hyper File View,Memory Zone or?
November 07, 2008 08:07PM
Paul, by default query-parameters are already NULL. So rewrite it as:

IF sSchool <> "" THEN
QRY_SchoolNameTest.ParamSchool = sSchool
END
IF sName <> "" THEN
QRY_SchoolNameTest.ParamName = sName
END
HExecuteQuery(QRY_SchoolNameTest)
iPreview(i100, "Pint preview", True)
iPrintReport(RPT_SchoolNameTest)

Arie
Paul Ziegler
Re: Hyper File View,Memory Zone or?
November 07, 2008 09:37PM
Arie,

Thanks. This helps a lot. Thanks to everyone to gave advice.

Paul
Toddy Utomo
Re: Hyper File View,Memory Zone or?
November 08, 2008 11:10AM
Hi Paul

try to use variant

sSchool is variant = Null

HExecuteQuery(QRY_SchoolNameTest,hQueryDefault,sSchool,"Smith")
iPreview(i100, "Pint preview", True)
iPrintReport(RPT_SchoolNameTest)

HTH
Paul Ziegler
Re: Hyper File View,Memory Zone or?
November 08, 2008 04:55PM
HTH ,

sSchool is variant = Null worked.

Thanks for the info. The more I use WD the more I am impressed with it scope.

Paul

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: