Hi everyone,
I have been modding AMC to use it as a basic stock cataloguing system. So far it is working as planned, and I am working on a order print out form using freereport.
I have designed the basic layout ok, but I am having problems using the SUM commands. They are documented a little in the help file, but it's a bit too complex for me.... Basically, all I want to do is multiply the [length] field by the [resolution] field.
Could anyone help me out please?
Thanks,
Dawson
Need help using fast report
It should be possible using the "script" option in the text fields of the report.
There is a basic example in the help file of AMC:
tmp1 := IntToStr(StrToInt([lenght]) * StrToInt([resolution]));
maybe it would work (or maybe not
I do not know that thing very well as it was not made by me)
There is a basic example in the help file of AMC:
If you do something like:In the window used for editing text items and pictures, a "Script" option can be checked. Then, the bottom part of the window allows to enter a script. The scripts used here are not related to those used by Ant Movie Catalog, except that the language used is also based on Pascal. Here are few examples:
If you want an image to appear only for Action movies, put the following code in the "Script" part of image's memo:
If you want to put the year between parenthesis after the title only if the year is specified for the movie (to prevent empty parenthesis), put the following code in the "Script" part of a text item:Code: Select all
begin Visible := [Category] = 'Action'; end;
Then place in the text area the code [tmp1] to use the script result as a new variable.Code: Select all
begin if ([Year] <> '') then tmp1 := [OriginalTitle] + ' (' + [Year] + ')' else tmp1 := [OriginalTitle] end;
tmp1 := IntToStr(StrToInt([lenght]) * StrToInt([resolution]));
maybe it would work (or maybe not

It did not work at first, but I have taken the IntToStr and StrToInt conversion commands out and simplified it down to -
Totalcost := ([Length]) * ([Resolution]));
and it works
Thanks for the help antp, much appreciated! I am considering trying a bit of coding myself, what do you suggest for a good begginer/starting point?
Totalcost := ([Length]) * ([Resolution]));
and it works

Sussed it!
If the QTY ordered field [Length] is empty, it caused the error. I have worked around it with the following code -
if ([Length] <> '') then
Totalcost := [Length] * [Resolution]
else
Totalcost := '-'
With regards to the IntToStr and StrToInt commands, should I try to implement them in? I am only use numerical characters in the fields, so will it matter?
Thanks again!
Dawson
If the QTY ordered field [Length] is empty, it caused the error. I have worked around it with the following code -
if ([Length] <> '') then
Totalcost := [Length] * [Resolution]
else
Totalcost := '-'
With regards to the IntToStr and StrToInt commands, should I try to implement them in? I am only use numerical characters in the fields, so will it matter?
Thanks again!
Dawson