Hello all, Is it possible to export objects using a report? The reason behind this is that we need to export our objects into text files for further processing. Unfortunately, we have quite a lot of objects in our database that are unused and therefore not licensed. A report could iterate over each object, check its license status and, if readable, could export it in text format. Doing this job manually is rather tedious: Select objects, try and export them, get an error, deselect the (single!) object that caused the error, try and export… As an alternative, is it possible to somehow set record marks programmatically within the object designer form? – Heinz Herbeck Waagner-Biro AG, Vienna, Austria
Basically you should be able to export objects like this:
Report DataItem Object (Table 2000000001)
OnAfterGetRecord()
Object.CALCFIELDS("BLOB Referenz");
IF Object."BLOB Referenz".HASVALUE THEN
Object."BLOB Referenz".EXPORT(STRSUBSTNO('C:\TEMP\%1_%2.txt', Object.Typ, Object.ID), FALSE);
This would create a file for each single object. (While testing this, I encountered trouble with the SubType, the TXT-Files are not editable …) But: In your case, I would mark all licensed objects and export them in ONE file! Well, you can not MARK automatically “records” in the ObjectDesigner, but you can “mark” the VersionList of objects with a special character, e.g. ~, so you could filter on it. A Report, that is exactly doing this, could be downloaded here: http://www.impuls-nbg.de/ Download Section, iWorkbench, Mark Licensed Objects (Englisch) (From the creators of the impuls Workbench) Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP
Wow, great! So the “BLOB Referenz” contains the “object code” of each object? When searching for a solution, I always thought this was the compiled binary code. Erm… What do you mean with “not editable” and the “SubType”? *********** Addition **************** Ok, now I tried your solution. The BLOB obviously contains the compiled binary. Tough luck… But I also downloaded the workbench report. I guess it will do the job. Thanks for the tip! *********** End of addition ********* Actually, I would prefer each object in a file of its own, so your solution is just the right thing for me. Marking the version list is also a great idea - the only small drawback is that we have some objects with the version list at maximum length… Thanks a lot! If this works, you saved me hours of work! [img]/forum/images/icon_smile_big.gif" border=“0”> – Heinz Herbeck Waagner-Biro AG, Vienna, Austria Edited by - xorph on 2002 Aug 08 11:35:10
quote:
Erm… What do you mean with “not editable” and the “SubType”?
What I mean with “not editable” is, that the BLOB-Export did not create a real Text-File which could be opened in a Text-Editor.
quote:
SubType Use this property to provide additional information about what will be contained in this field. This property only applies to BLOB fields. Applies to Fields Settings The SubType settings are: If you will store… Choose… Bitmaps Bitmap Memos Memo User defined information User-Defined (default) Comments When you use C/AL functions IMPORT and EXPORT, the system will provide a dialog window from which the user can pick the BLOB to import or export. Based on your selection here, the system will show only the appropriate file types. For instance, if you select Bitmap, the system shows only files with the extension .bmp. If you select Memo, the system shows only files with the extension .txt. If you select User-Defined, the system shows all files.
So, what I expected was, that the BLOB-Subtype of objects is MEMO, and so, if I specify the BLOB.EXPORT as *.txt, then the result would be a “real” Text-File. Well, it isn’t … bad Luck Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP
Yes, it seems that the SubType property merely selects different file extensions in the common dialog. Anyway, I used the report you mentioned, and it did a great job. It took me a couple of minutes to get everything exported, instead of more than an hour the last time I had to do this. – Heinz Herbeck Waagner-Biro AG, Vienna, Austria