learner
21st December 2002, 06:55
i am new to baan, i have 2 basic doubts

Firstly, i have one session in which i am sending some data on report and then doing some processing in report script...in report script i have taken one variable ...now i want to sort my report on the basis of this variable...how can i do this......???

Secondly, can i take variables or fields which r declared in report script in Report Input fields for ordering purpuse ?

Thirdly, I have one form on which there are 5 text boxes for item codes, i have given the zoom option also on that fields (tiitm0502s000), but how do i ensure if user does not zoom in the text box and he writes the item code by himself....that should be validated with the item master...how can i do this.....in which section i will have to write ...if a small code could be given for that i would be helpfull....my primary index is item code


Regards

morpheus
21st December 2002, 07:09
Q1.
Yes, you can use the report variable to sort your output. Use session - ttadv3132s000 (Maintain Report Input Fields).

Q2.
Yes.

Q3.
For this, there are 2 options -
a. Modify the table definition of your table. Put reference for the item field. Refer it to Item Master.
OR
b. Use on.input sub-section, and write a query to check the input done.

Hope things are clear.

KlayVessel
2nd January 2003, 07:49
Originally posted by morpheus
Q1.
Yes, you can use the report variable to sort your output. Use session - ttadv3132s000 (Maintain Report Input Fields).

That wouldn't work if the variable is being changed or set in the report script (as the original question implies). The "after.receive.data" section appears to be able to be used for this purpose but it really occurs after the sort so it's incredibly useless -- probably why you've not seen it or used it before :D.

The easiest solution is to change the session script, if you have access to that, so that it sets the appropriate sort field values. There is another solution, I won't go into detail here but will give you a hint: a Baan report is just another 3GL so you can use one report to execute another report. An intermediate "report" would not actually output anything, but would be there just to do the data manipulation and pass the new fields on to the real report.



Q3.
For this, there are 2 options -
a. Modify the table definition of your table. Put reference for the item field. Refer it to Item Master.
OR
b. Use on.input sub-section, and write a query to check the input done.

a. works great. b. should be "check.input:" sub-section I think.

morpheus
2nd January 2003, 08:08
That wouldn't work if the variable is being changed or set in the report script (as the original question implies). The "after.receive.data" section appears to be able to be used for this purpose but it really occurs after the sort so it's incredibly useless -- probably why you've not seen it or used it before .

It will still work even if the program script variable in changed in the report script!! And why do you want to use the "after.receive.data" section!!:rolleyes:

a. works great. b. should be "check.input:" sub-section I think.

Try using "on.input". It might work!!;)

KlayVessel
2nd January 2003, 08:50
Originally posted by morpheus
It will still work even if the program script variable in changed in the report script!! And why do you want to use the "after.receive.data" section!!:rolleyes:

No, the original poster is chaning the variable within the report script itself. This will not work because the sort occurs before you can access the variable. That is, the data is imported from the session and written to the temporary file but there is no event to include code before it is written to the temporary file. I didn't "want to use" the after.receive.data section, I stated that it would not work even though it appears from the help text that it should occur at this point (immediately following the import from the parent session), it occurs just after each record is read from the sort file -- well if there is no sort file then it would occur immeidately after the import.

Try using "on.input". It might work!!
Might...but check.input is the one designed for this and the only place where the set.input.error() function is documented to operate correctly. This is the proper way to return the user to input on the field when a field error occurs.

morpheus
2nd January 2003, 10:46
Yes, the variable is accessed after the sort.