[Tutorial] Pictures in Base
Posted: Mon Sep 19, 2011 2:12 pm
All binary types of pictures supported by OOo can be stored in database table. The OOo Draw .odg files can be stored with macros (which is out of this tutorial.).
The svg files can be stored in tables but can not be shown in forms and reportbuilder reports (not renders).
Tables
You can store pictures in fields type set as Image(LONGVARBINARY) in Base table design mode.
Much reasonable to store pictures in your file system, and put link into the Text(VARCHAR) type fields.
In case of small size pictures (less than 100kb), with the limited number of records (less than 1000) the first option will be good. When your odb file size grow up to the 50MB, there will be a performance problem or you can not work with your file, can not add new data, picture.
The case of photos which have ~2MB or more, I suggest to use second option.
Forms
In forms the image controls can be bound to the both type of fields. The images can be added through image control to the table. The linked pictures stored texts can be shown if you put two controls (one image and one text) bounded to the same fields.
Form wizard recognizes the VARCHARBINARY types as picture, the linked picture text field needs to be changesd by “Replace with” option in form control local menu, or in form navigator.
Reports
“Old” type reports not handle images, same apply to the mail merge documents.
Report wizards recognizes only the VARCHARBINARY type fields as picture, the linked picture inserts as text field, you needs to change the report control to the image control, by deleting and inserting.
Example file: http://user.services.openoffice.org/en/ ... hp?id=5182
The svg files can be stored in tables but can not be shown in forms and reportbuilder reports (not renders).
Tables
You can store pictures in fields type set as Image(LONGVARBINARY) in Base table design mode.
Much reasonable to store pictures in your file system, and put link into the Text(VARCHAR) type fields.
In case of small size pictures (less than 100kb), with the limited number of records (less than 1000) the first option will be good. When your odb file size grow up to the 50MB, there will be a performance problem or you can not work with your file, can not add new data, picture.
The case of photos which have ~2MB or more, I suggest to use second option.
Forms
In forms the image controls can be bound to the both type of fields. The images can be added through image control to the table. The linked pictures stored texts can be shown if you put two controls (one image and one text) bounded to the same fields.
Form wizard recognizes the VARCHARBINARY types as picture, the linked picture text field needs to be changesd by “Replace with” option in form control local menu, or in form navigator.
Reports
“Old” type reports not handle images, same apply to the mail merge documents.
Report wizards recognizes only the VARCHARBINARY type fields as picture, the linked picture inserts as text field, you needs to change the report control to the image control, by deleting and inserting.
Example file: http://user.services.openoffice.org/en/ ... hp?id=5182