report # 405 order

i want to add the following information to the report 405 Order , but i cant succeed… any body help me out

  1. vendor phone, fax and email id - this just below the vendor name & address

  2. item - vendor item no – in item lines area

Number 2 is easy, you need to add a field with the following “Purchase Line”.“Vendor Item No.” specified, you can just copy one of the others and put it in.

For Number 1 you need to get this from the vendor as it is not on the purchase header so you would need to declare a variable and then bring in the information as “Vendor”.“Phone No.”, you will probably have to write some code to reference the purchase header to get the correct vendor for that purchase order as well, I think it will be against the purchase header dataitem and read:

VENDOR.GET(“Purchase Header”.“Buy-from Vendor No.”);

Where “Vendor” is the decalred variable, put it after the CompanyInfo.GET line.

However I am not a developer, so test it first, and post again if it does not work so a proper developer can answer this! [:D]

[;)]

i try both, i was able to get vendor item number, but for vendor email, i cant. please explain a little bit more.

thanks in advance.

To get the vendor master information you will need to first add a global variable Vendor type record and subtype vendor. (View/Globals)

after you add the variable click on c/al for the data item Purchase header, add the following code in the onaftergetrecord trigger at the bottom:

Change the “Buy-From” to “Sell-to” or “Ship-to” depending on which vendor you want to display.

IF NOT Vendor.GET(“Buy-from Vendor No.”) THEN

Clear(vendor);

In the header section of the report add the text fields you want and the source will be

vendor.(field Name) ex: vendor.“E-mail”

thanks everybody…its working fine.

further i stuck up with two more things although i was able to successfully add necessary documentation into the report. the issue is

  1. i need to add company logo at top of report and a footer on each page.

  2. i want to add purch comment line (comment field) into the report. i suppose i need to first declare a variable of type record and then in purchase header code filter the Purch Comment Line with Document Type and No.

this i am unable to achieve.

Also, please let me know the syntax and functionality of GET and SETFILTER functions.

Look at report 10075(Sales Order) to see how comments are added.

Do you want the logo that prints at the top to be the logo you have imported into company information?

yes…i want same logo as in company information…further i want a footer which can be image or text

For the company logo you need to add the bolded underlined code below in the on after get record.

Purchase Header - OnAfterGetRecord()
CurrReport.LANGUAGE := Language.GetLanguageID(“Language Code”);

CompanyInfo.GET;
CompanyInfo.CALCFIELDS(Picture);
IF RespCenter.GET(“Responsibility Center”) THEN BEGIN
FormatAddr.RespCenter(CompanyAddr,RespCenter);
CompanyInfo.“Phone No.” := RespCenter.“Phone No.”;
CompanyInfo.“Fax No.” := RespCenter.“Fax No.”;
END ELSE
FormatAddr.Company(CompanyAddr,CompanyInfo);

Then in the view section pageloop, header(1) make some room where you want the picture.

Select the toolbox and select the Image Box icon, draw the image box onto the section. You might have to adjust it later for the exact size.

After you have added the box, select it and click on the properties for the box, go to the SourceExpr and enter CompanyInfo.Picture.

Thats it for the company logo.

In the footer do you want static text and picture or will it change based upon something?

footer will be static text + image.

amer ms, you would be better off tostart a new thread.

Many people follw this site through means such as RSS, and would not realize that you have now added a new topic to this thread. I suggest that if you have four questions, create four seperate threads. You have abetter chance of getting a reply that way.

To create the footer and text/picture you will need to view sections in the design on the report.

Then go to Edit/New

Select Loop3 and footer

This will create a section at the bottom of the view/sections

To add the static text select tools and the label, then draw the label into the section. got that label go to its properties and add the static text in the caption.

To add the picture field, if you do not want to add a blob field in a table somewhere to call you will need to in the section, select tools and select the image tool, draw the image onto the section, in the properties of that object you will need to enter the full path and file name for the picture. The picture must be a bmp. Note: the path must be locatable for this picture anytime you want to compile the report. You can not enter a URL.

You may have to play with the document sections to insure it is paging, placement is correct. There are alot of sections in this report.