Page 1 of 1
Inventory list with pictures
Posted: Sat Jul 02, 2011 9:46 am
by bwolfsohn
Are any of you producing inventory columnar reports with pictures ???
We have hundreds of reports, but very few include pictures..
We work with pictures throughout the rest of the program. I'm sure it's simple, but my brain is set on stupid lately, so i thought i'd just ask around to see what pitfalls, suggestions y'all might have..
TIA
Brian
Re: Inventory list with pictures
Posted: Mon Jul 04, 2011 7:25 am
by rdonnay
Brian -
Are you asking how to do this or just whether or not it is a good idea?
I have written a few apps that use photos in a browse column.
Performance is quite good.
Roger
Re: Inventory list with pictures
Posted: Mon Jul 04, 2011 7:58 am
by skiman
Hi Brian,
I suppose you want to print pictures on reports?
Some results:
http://www.aboservice.be/prijslijsten.php
Do you have specific questions? One of the things you have to do is calculating if a picture can be printed on a current page, or if you need to do an eject first.
Re: Inventory list with pictures
Posted: Tue Jul 05, 2011 3:31 am
by unixkd
Hi Roger
Can you please post a sample code of how to browse pictures stored in a blob field, that will be very helpful
Re: Inventory list with pictures
Posted: Tue Jul 05, 2011 7:14 am
by bwolfsohn
skiman wrote:Hi Brian,
I suppose you want to print pictures on reports?
Some results:
http://www.aboservice.be/prijslijsten.php
Do you have specific questions? One of the things you have to do is calculating if a picture can be printed on a current page, or if you need to do an eject first.
Chris,
Nice reports...
No specific questions... we're already doing re-sizing/optimizing/creating thumbnails, etc...
Just wondering what issues people have hit... wondering about memory usage increase on the preview of large reports.. maintaining picture quality vs report size.
Re: Inventory list with pictures
Posted: Tue Jul 05, 2011 8:25 am
by skiman
Hi,
On some reports we disable our preview functionality, this to prevent memory problems. If they are too large, speed is going dramatically down.
Re: Inventory list with pictures
Posted: Tue Jul 05, 2011 11:07 am
by rdonnay
Can you please post a sample code of how to browse pictures stored in a blob field, that will be very helpful
The below code uses the BMPDB.DBF and BMPDB.FPT files that are part of the Xbase++ distribution in \Alaska\Xppw32\Source\Samples\Data
Code: Select all
#INCLUDE "dcdialog.CH"
#Pragma Library("dclipx.lib")
#Pragma Library("dclip1.lib")
FUNCTION Main()
LOCAL GetList[0], GetOptions, oBrowse, oBitmap, aBrowPres, oStatic
DC_LoadRdds() // load all database engines
USE bmpdb VIA "FOXCDX"
oBitmap := XbpBitmap():new():create()
aBrowPres := ;
{ { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE }, /* Header FG Color */ ;
{ XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY }, /* Header BG Color */ ;
{ XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_DOTTED }, /* Row Sep */ ;
{ XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_DOTTED }, /* Col Sep */ ;
{ XBP_PP_COL_DA_FGCLR, GRA_CLR_BLACK }, /* Row FG Color */ ;
{ XBP_PP_COL_DA_BGCLR, GRA_CLR_WHITE }, /* Row BG Color */ ;
{ XBP_PP_COL_DA_ROWHEIGHT, 100 }, /* Row Height */ ;
{ XBP_PP_COL_HA_HEIGHT, 20 }, /* Header Height */ ;
{ XBP_PP_HILITE_FGCLR, GRA_CLR_WHITE }, /* Hilite FG color */ ;
{ XBP_PP_HILITE_BGCLR, GRA_CLR_BLUE }, /* Hilite BG color */ ;
{ XBP_PP_COL_FA_FGCLR, GRA_CLR_WHITE }, /* Footer FG Color */ ;
{ XBP_PP_COL_FA_BGCLR, GRA_CLR_DARKGRAY }, /* Footer BG Color */ ;
{ XBP_PP_COL_FA_HEIGHT, 10 } /* Footer Height */ ;
}
@ 0,0 DCBROWSE oBrowse ALIAS 'BMPDB' SIZE 40,30 PRESENTATION aBrowPres ;
ITEMMARKED {||oBitMap:setBuffer(BMPDB->BITMAP,XBPBMP_FORMAT_WIN3X), oStatic:setCaption(oBitmap)}
DCBROWSECOL FIELD BMPDB->name HEADER 'Name' WIDTH 10 PARENT oBrowse
DCBROWSECOL DATA {||oBitMap:setBuffer(BMPDB->BITMAP,XBPBMP_FORMAT_WIN3X), oBitmap} ;
HEADER 'Image' WIDTH 20 PARENT oBrowse TYPE XBPCOL_TYPE_BITMAP
@ 0, 42 DCSTATIC TYPE XBPSTATIC_TYPE_BITMAP CAPTION oBitmap SIZE 60,30 OBJECT oStatic
DCREAD GUI FIT
oBitmap:destroy()
RETURN nil
* ---------
PROC appsys ; RETURN