Navision 4. Show CompanyInfo Picture in report picture box.

delaghettodelaghetto Member Posts: 89
Hi all,

I'm trying to add the Picture stored in CompanyInfo table in a report's picture box control.

I have defined a global variable in the report called CompanyInfo of Datatype record and subtype "Company Information"

Then in the reports OnInitReport() I have the following code:
CompanyInfo.GET;
CompanyInfo.CALCFIELDS(Picture);

Then in the picture box control SourceExpr I have set CompanyInfo.Picture

But when I print the report, the image does not show up. Any ideas of what can I be missing? In the Sales Shipping report, the image shows correctly. :roll:

Comments

  • whitaker_timwhitaker_tim Member Posts: 23
    Are there any settings on the picture box to set visible to no? Have you tried to copy the picture box from the sales shipment report to the new report to see if it displays? Have you tried placing the code in the OnPreReport, I think this is the standard location?

    I have asked a couple of questions but it is difficult to answer without knowing the NAV version details and the report customizations, can you provide a little more detail?
    Tim Whitaker | Senior NAV Consultant/Developer | The Software Workshop Ltd. | http://www.thesoftwareworkshop.com
  • satbirsatbir Member Posts: 33
    check to see if there is another
    CompanyInfo.GET;
  • ftorneroftornero Member Posts: 524
    The best way is define the first data ítem with Company Information (you can change de Name to Logo), and then in the Sections, create a body for this dataitem and put into the field (Picture).
    And in the Body - OnPreSection() write this

    CurrReport.SHOWOUTPUT(FALSE);
  • delaghettodelaghetto Member Posts: 89
    Thanks for the answer guys,

    I really don't know what's going on here. There is no other CompanyInfo.GET, as the global variable CompanyInfo was created by me.

    Version is MBS Navision 4.0 SP3. I've also tried to copy the picture box from the sales shipment report, visible is set to yes and I've tried to put the code in "OnPreReport"

    I haven't tried to play with the "data items", coz I'd rather do it the standard way. I'm just trying to copy the same way that's in all other standard reports like 208 - sales shipment.

    The report I'm trying to put this in is the Report 1401 Check. Don't know if this report has something special that i can't
    add the picture to it.

    ](*,) ](*,) ](*,)
  • geordiegeordie Member Posts: 655
    Hi, I added the picture on report 1401 in PrintCheck footer section for testing purpose and I didn't face any problems: I made this test on a 4.03 Cronus (obj. version NAVW14.00.03).

    I noticed a record variable called "CompanyInfo" is already defined as global by standard (GET is performed in GenJnlLine - OnPreDataItem trigger): didn't you get any error adding your own variable with the same name? :?:
  • delaghettodelaghetto Member Posts: 89
    There wasn't any CompanyInfo variable in my report 1401. This is the first time I'm in this project, so I guess the report has been modified before.

    I finally decided to test the "Data Item" approach, and the picture is showing up!, so at least I have a solution. The thing is that now I have a new filter in the report that I need to remove:



    Is the CurrReport.SHOWOUTPUT(FALSE); code to hide this? I put this code as suggested in the body of the section, but no luck.

    I would like to know at least how to remove this, but actually what I need is to put the picture in the PrintCheck Section. I'm really sorry for insisting with this topic, but I just can't figure it out.

    Thanks for helping guys!
  • geordiegeordie Member Posts: 655
    No problem, just add SORTING(Primary Key) in DataItemTableView of Company Information dataitem.
Sign In or Register to comment.