IF Item1.FINDFIRST THEN REPEAT Item2.SETRANGE(''No'', Item1''No''); IF Item2.FINDFIRST THEN BEGIN Item2.CHANGECOMPANY('Company2'); Item2.Picture := Item1.Picture; Item2.MODIFY; END; UNTIL Item1.NEXT = 0;
IF Item1.FINDFIRST THEN REPEAT FileNameExport := 'C:\Temp\' + FORMAT(Item1."No.") + '.jpg'; FileNameImport := 'C:\Temp\' + FORMAT(Item1."No.") + '-1.jpg'; Item2.SETRANGE''No'', Item1''No''); IF Item2.FINDFIRST THEN BEGIN Item2.CHANGECOMPANY('Company2'); Item1.Picture.EXPORTFILE(FileNameExport); Item2.Picture.IMPORTFILE(FileNameImport , 'Demo Image'); END; UNTIL Item1.NEXT = 0;
IF Item1.Picture <> '' THEN ...does this example for this is ok:
IF Item1.Picture.COUNT > 0 THEN ...
Answers
But IMPORT 'C:\Temp\' + FORMAT(Item1."No.") + '-1.jpg';
That another name files...
And check this: MSDN
UPD. U can check this: IMPORTFILE function. Have nice Example for ur issue.
I've already read those posts and I'm using standard examples for Import/Export file functions.
Why I'm using different name while import is a good question. I'm doing that cause export of the image is successful and I don't know why, before the extension type while exporting I'm always get to all pictures -1. As you see I'm get the Item number for the name but when picture is exported if I don't add -1 in import function I get error that the file does not exist. When I go in C:\TEMP folder i see that pictures are exported as
1000-1.jpg
2001-1.jpg
3010-1.jpg etc...
I'm sure there must be a way to import the pictures from company into company without export and import pictures.
Best Regards