Форум: "Прочее";
Текущий архив: 2008.01.27;
Скачать: [xml.tar.bz2];
ВнизДобавление функции преобразования суммы прописью в FastReport 4 Найти похожие ветки
← →
RUYurik (2007-12-18 12:23) [0]Здравствуйте! У меня есть невизуальный компонент для преобразования суммы в пропись. Как мне его подключить к FastReport"у чтобы там при суммировании постранично сумм выводить на каждой сумму прописью?
← →
Andrey © (2007-12-18 13:49) [1]И каким боком это к IB/FB относится?
goto http://fast-report.com/ru/forum/
← →
RUYurik (2007-12-19 06:02) [2]IB/FB в вопросе не указывается. А на форуме фастрепорта я не нашел все таки как подключить его.
← →
atruhin © (2007-12-19 06:42) [3]> А на форуме фастрепорта я не нашел все таки как подключить
> его.
Плохо искал. Вообще в Фастрепорт есть стандартная функция преобразования суммы в строку,
ищи в документации.
Ну и вот пример подключения своих функций:
unit fs_MyFunc_rtti;
interface
{$i fs.inc}
uses fs_iinterpreter, fs_ievents, Classes,
DateUtils, SysUtils, Math, Types, StringConv;
type
TfsDateUtilsRTTI = class(TComponent);
implementation
type
TFunctions = class(TfsRTTIModule)
private
function CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
public
constructor Create(AScript: TfsScript); override;
destructor Destroy; override;
end;
//var
// Functions: TFunctions;
function GetWord(Str : string; Index : integer): string;
var
S : string;
begin
Result := "";
while (Index > 0)and(Str <> "") do begin
S := scQStrSplit(Str,"|");
dec(Index);
if Index = 0
then Result := S;
end;
end;
constructor TFunctions.Create;
begin
inherited Create(AScript);
with AScript do begin
AddMethod("function ObjToInt(const Obj : TObject): integer", CallMethod,"MyFunction","");
AddMethod("function GetWord(Str : string; Index : integer): string", CallMethod,"MyFunction","");
AddMethod("function ExtractFilePath(const FileName: string): string", CallMethod,"MyFunction","");
AddMethod("function ParamStr(Index: Integer): string", CallMethod,"MyFunction","");
end;
end;
destructor TFunctions.Destroy;
begin
if fsGlobalUnit <> nil then
fsGlobalUnit.RemoveItems(Self);
inherited;
end;
function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
Result := 0;
if MethodName = "OBJTOINT" then
result := integer(Caller.Params[0])
else
if MethodName = "GETWORD" then begin
result := GetWord(Caller.Params[0], Caller.Params[1]);
end else
if MethodName = "EXTRACTFILEPATH" then
result := ExtractFilePath(Caller.Params[0])
else
if MethodName = "PARAMSTR" then
result := ParamStr(Caller.Params[0])
else;
end;
initialization
fsRTTIModules.Add(TFunctions);
end.
Страницы: 1 вся ветка
Форум: "Прочее";
Текущий архив: 2008.01.27;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.007 c