learner
28th January 2003, 19:09
Hello,

I have one customized PRINT Session, I have 1 variable on the report which basically contains the month_no. e.g. in case of July it will have value 7

Now what i would like to display is

TOTAL FOR THE MONTH OF JULY 200
instead of
MONTH TOTAL FOR 7 200

I did a little bit of home work also by doing the following
in report script in a section.

String str(15)
str = sprintf$("%D (%H)",month_no)

so in this case str returned me JULY

now here goes my requirement, I would not like to write this code in Report script or Program script. I would like to specifiy it on the Field which i have taken on my report, for that i specified the following statement in PRINT FORMAT

sprintf$("%D (%H)",month_no)

but on compiling the report Baan gave me error that chr(37) not expected ....i don't have the exact retured error right now, but during compilation only i encountered errors.

Please GURUS help me out, and tell me how can i do it without using program script or report script.

I would like to specify this at REPORT DESIGN LAYOUT for that field(month_no).

gous99
28th January 2003, 19:23
Take your sprintf() expression and put it directly into the Print Expression, instead of in print format.

learner
29th January 2003, 14:43
Hi,

Thanks it solved my problem. :)
but just tell me why i need to do all this
format related thing in PRINT EXPRESSION rather than in PRINT FORMAT ?
Is it because i am using sprintf$() ?

gous99
29th January 2003, 14:59
As you can see, the field is called Print Expression, and that's why you can put more formatted expression here.

For example, if you want to concatenate 2 fields you can put it in there, something like strip$(field1) & field2, or a calculation,
say on your report you have a field called price and a field called quantity, then you could create another field on your report and put in the Print Expression : price * quantity, and the result of it would be printed.

evesely
29th January 2003, 16:09
You should also be able to just put %D(%H) [notice no sprintf$] in the Print Format field in your print expression is a date.

learner
29th January 2003, 21:29
Hi,

Thanks All