PDA

View Full Version : Including financial status into Session Reports


david
27-04-09, 08:59 AM
The following is the relevant part of an email exchange with Ian regarding including an indicator of a player's financial membership status in the normal session or ratings report. I have put it in the forum in case it is of value to others.:)

To make it clear I have put Ian's responses in italics.

In response to whether using the paid to field or parameter fields was best:

using the paid-to date is the best way to go.
In member records use F7 paid 1 year from today
and F8 paid to expiry date (entered in club details screen) to set the date for each person.

The ratings report does have financial1 and 2 for both players.
T = true and F =false
See example for an event with two fields attached.
I had to write code to do it properly....
procedure DBText2OnGetText
var
F1, F2: string;
begin
if PairRatings['xFinancial1'] = 'T' then
F1 := ' (M) '
else
F1 := ' (NM) ';
if PairRatings['xFinancial2'] = 'T' then
F2 := ' (M) '
else
F2 := ' (NM) ';
Text := trim(PairRatings['Name1']) + F1 + trim(PairRatings['Name2']) + F2;


Other questions:
3. I have read the LearnRB guide and played around with the ASE report designer, am I right that in ASE you have hardcoded some database queries for the various reports and that you do not allow users to start with constructing their own queries?
In members reports, [File][new] will let you include whatever fields you like.


4. Am I right that the data accessible for a session results report or equivalent does not include the parameter fields for a player?
They are there. see
[Calc] tab in designer [Language] +[Function] [player details] "parameter(number)"


5. I do find the fields Financial, xFinancial1 and xFinancial2 on the PairRatings query- are these meant to capture the financial status (as per the Paid to field) for the pair, and player 1 and 2 respectively?
yes

Is there a data glossary for the various data queries?
the fields are listed in the report pull down list
and in the report screen see [options][data layout] for making a description file


6. Is there more reading you can refer me to that would help me progress?
Perhaps this information should be on the forum where it can built up with questions like these?
I could write for weeks on this. :-(

Cheers,
Ian

David

david
27-04-09, 09:28 AM
Thanks Ian for your responses. I was not able to attach the sample report you sent me by email.

Some further questions.

1. You referred to the procedure DBText2OnGetText that you had to write - is this embedded into the report file itself? Certainly when I installed your sample report locally it appeared to work fine. If I wanted to edit the procedure to change the "(M)" etc - is that something I can do? If so how?

2. Member Reports [File][new] allows me to include the data I want in a new report - thanks for showing me the way here. Is there a similar way to add data fields to an existing report (such as a session or ratings report)?

3. Reports | Session right click | Change | Designer [Calc] - can't find a [Language] tab or option? Am I in the wrong spot?

Thanks - David:)

ianmac
05-05-09, 01:02 PM
Thanks Ian for your responses. I was not able to attach the sample report you sent me by email.

Have attached here (use zip file).

Some further questions.

1. You referred to the procedure DBText2OnGetText that you had to write - is this embedded into the report file itself?

Yes. [Calc] tab, [view][events] +detail > DBText2

Certainly when I installed your sample report locally it appeared to work fine. If I wanted to edit the procedure to change the "(M)" etc - is that something I can do? If so how?
see the "ongettext" event for DBText2

2. Member Reports [File][new] allows me to include the data I want in a new report - thanks for showing me the way here. Is there a similar way to add data fields to an existing report (such as a session or ratings report)?

No, those reports are limited in their content

3. Reports | Session right click | Change | Designer [Calc] - can't find a [Language] tab or option? Am I in the wrong spot?
Find this in the lower right panel, in the code toolbox. The [data][objects][language] tabs are at the bottom.

david
05-05-09, 02:42 PM
Thanks Ian.:)

david
11-05-09, 03:45 PM
Me again, Ian.

I have tried to learn from your procedure and replies and to include the players' respective first parameter values into the default session report. I have constructed a DBText2OnGetText procedure as follows:

var
F1, F2: string
begin
F1 := function Parameter(const 1,1)
F2 := function Parameter(const 2,1)
Text := trim(PairRatings['Name1']) + F1 + trim(PairRatings['Name2']) + F2;
end;

but on saving and then trying to preview the report I get a "Cannot generate report. Could not compile program:DBText2OnGetText" error.

Am I missing something stupid? :confused:

David

ianmac
12-05-09, 05:13 AM
It is not Pascal code, that's all ;)
BTW right-click the code you have written and choose "compile" to check before running it.


var
F1, F2: string;
begin
F1 := Parameter(PairRatings['PlayerNo1'], 1);

F2 := Parameter(PairRatings['PlayerNo2'], 1);
Text := trim(PairRatings['Name1']) + F1 + trim(PairRatings['Name2']) + F2;

end;

david
12-05-09, 06:47 AM
Pascal? He was a mathematician wasn't he?:D

Actually my wife knows/knew Pascal - I will lean on her a little in the future. I was just trying to lift the syntax from the Language tab fields - obviously there was an interpretation layer I missed!

Thanks, Ian, for your ongoing help - David.

ianmac
12-05-09, 07:57 AM
BTW you can get the correct syntax by drag and drop.
eg with "Parameter" see the 9 dots to the left [...] Click that and drag to code area, drop, and you get:
Parameter(PlayerNo, ParameterNo);
Then drag "PlayerNo1" and drop to the left of "playerno" and you get:
Parameter(PairRatings['PlayerNo1']PlayerNo, ParameterNo);
Delete "Playerno" and you have
Parameter(PairRatings['PlayerNo1'], ParameterNo);
then change parameterNo to 1 for:
Parameter(PairRatings['PlayerNo1'], 1);