Display a picture in an array?

anniqaanniqa Member Posts: 16
edited 2007-11-19 in Navision Attain
I made a Label-Typ report to create labels which should include the Item.Picture field. I can't find any good example in the C/AL reference guide how to accomplish this, all outstream examples uses text.

When I try to assign the following to a variant variable the compiler doesn't like the syntax.
recitem.Picture.CREATEOUTSTREAM(pic);where pic is an Outstream global.
How would I get the resault which I'd like to assign to an Arr[]?

Comments

  • kinekine Member Posts: 12,562
    1) You want to show more pictures in one Section? If yes, you need to use Array of records. You cannot "save" blob into variable.

    2) It means to use something like recItem[1].Picture etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • anniqaanniqa Member Posts: 16
    Yes, I made a report with two columns with the intention to print shelf-labels from the Item table. NAV then creates a two-dimensional array which behaves perfectly till it comes to the picture field....just can't figure out how to get the addr[1][5]to show the picture instead of '*' .
  • kinekine Member Posts: 12,562
    You need to use PictureBox and not editbox.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • anniqaanniqa Member Posts: 16
    The problem is that if I use a Picture box it picks the same picture in both columns...I'd like to get the picture-field into the array somehow. Thought the trick was outstream to place a blob into an array...no success:(
  • kinekine Member Posts: 12,562
    No, you are thinking in wrong way. For reading the picture, you are using some record. You can create new record variable with same type and create array of these record. you just needs to get correct record into each variable and use it in the Picture box. It means you cannot create the array of just the field picture, but you can create array of whole records with the field...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • anniqaanniqa Member Posts: 16
    What I'm trying to achieve is to display a picture in a [arr] ?? it should be possible?
  • kinekine Member Posts: 12,562
    Are you reading, what I wrote? You cannot create array of pictures, but you can create array of records with picture field. You cannot store picture in some variable, you can just use the BLOB field of some record. But you can create array of records without problems. Think about it, try it, if you have some problem with it, ask.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • anniqaanniqa Member Posts: 16
    by NAV when I use the wizard to make a label-type report. And when I pick the Item.Picture as SrcExp instead of Addr[ColumnNo][5] it doesn't understand that it should be the next picture, it picks the same picture in both columns.
  • kinekine Member Posts: 12,562
    Of course.

    I will not repeat what I wrote. You cannot just replace text variable by picture variable in NAV. It is not working in this case. You need to change the logic and use array of records instead array of text variables. And you cannot use same control as for text when you want to show picture.

    But because for me it seems that you are not skilled in this, I recommend to read some documentation first, or just to try how to show some picture in simple report.

    If you will succeeded in this simple task, try second step - show two pictures in one section.

    The wizard is not working in this case, you need to do some C/AL coding for that and create the controls on the sections manually.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • anniqaanniqa Member Posts: 16
    is that when I created a report without the wizard and skipped the columns and added the controls "manually" just to test the following works!!???

    Addr[ColumnNo][1] := FORMAT("No.");
    Addr[ColumnNo][2] := FORMAT(Description);
    Addr[ColumnNo][3] := FORMAT(Picture);
    Addr[ColumnNo][4] := FORMAT("Recommended Price");
    Addr[ColumnNo][5] := FORMAT(Barcode);
    Addr[ColumnNo][6] := FORMAT("Label Text");
  • kinekine Member Posts: 12,562
    Addr[ColumnNo][3] := FORMAT(Picture);
    

    You cannot format Picture to text [-X

    You cannot use Addr variable for picture [-X

    Sorry, but may be someone other will be able to describe the solution for you. ](*,)

    But once again, try to find out how the Picture Box works (e.g. on some report which is using logo from CompanyInfo), try to learn some NAV basics (e.g. application designer guide).

    And take it easy, sometime it is hard for me to describe something obvious for me to someone other, just keep learning and trying...
    8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.