I am creating a report using the Sales Header table. There are two requirements remaining and the report will be complete. 1. I want to ALWAYS choose Orders as a required field as opposed to choosing between orders, quotes, credit memos, invoices, etc. Can’t remember how to have the query look at just the orders. 2. I want our company logo to appear on the report. Can’t remember how to get the logo (blob) in the header of the report. Any help with these two areas will be appreciated!
- change the dataitemview to - WHERE(Document Type=CONST(Order)) 2) if the company logo is in company information table then use the code “company information”.get; //create a record variable too “company information”.calcfields(picture); put a textbox with SourceExpr “company information”.picture
Company logo: Insert a picture box in the header or where you want it to appear. In property “sourceexp” write the the path to the picture and set the property “bitmap” to 0 Remember that the max. size of the picture must be 32 kb, and only *.bmp
Thank you for the quick replies!!
32k is tiny - how do I print with various letterheads (I’ve got a 1.5Mb bmp, or I can get it as a jpg). Thanks Chris
The two described above: 1. Link directly to a picture in a directory on your drive (max 32KB) [Uses Image Control, set Bitmap propery to c:\images\myimage.bmp] 2. Do a calfields on the company table (no maximum as far as I know, except for the max on the Blob fields) [Uses Picture Control, set SourceExpr Property = tablename.blobfield] I would like to talk a bit more about 2, as this would fit you best. Two choices again: 2.1 Extra fields on the Company table. Create new field called Logo2, Logo3, etc. Make sure that you add code in order to load new logo’s to the right fields On your report, place 2 more picture controls. At the same place where you do the calcfield of the blob field, have an if statement so that you only calculate one of the images at a time. This will result in displaying only one image on the report 2.2 Create a new table called Images(Key,BlobImage). On your report, only have the one Picture control. Where you calculate company logo, rather find the correct record with the logo that you want to print, then calclute that BlobImage. Make sure you change the reference of you Picture box to the Images.BlobImage. Regards, gus
Thanks - found & used the picture field on the contact card. How do I scale it ? The logo appears to be printing at 72dpi. I created it at 600dpi, so most of it is off the page. I could rescale it to 72dpi, but then it would look lousy. Another report which uses the companyinfo picture looks like it’s at 600dpi or thereabouts. Thanks, Chris
Scaled it - downloaded irfanview & fixed the bitmap. MS Photo Editor & Paint don’t do it. Now I can use a picture field in the contact ok, but can’t seem to lookup the company contact picture correctly. I’ve tried CompanyContact.RESET; CompanyContact.SETCURRENTKEY(“No.”); CompanyContact.SETRANGE(“No.”,Contact.“Company No.”); CompanyContact.FIND(’-’); in the onpresection and in the onaftergetrecord, but no joy. Why doesn’t companycontact.picture work ? Thanks Chris
The Picture field is a BLOB. You need to have a CompanyContact.CALCFIELDS(Picture); in your code for the content of a BLOB field to be displayed. PS: Can’t you just do a CompanyContact.GET(Contact.“Company No.”); instead of your current code?
CALCFIELDS - thanks. And yes, GET works too, thanks. I’d just copied that other code from a working report someone had done for us. Now nicely simplified - but how does it know which key to use (No. rather than Company No, Search Name, or whatever) ? Thanks, Chris
get() uses primary key
Thx to Sat S! Went ahead and entered the info as presented in your first reply and everything worked fine the first time. Document Type defaults to Orders and the company logo prints in the upper left hand corner perfectly…