Sales Invoice Report RTC (code 206)

ceccomilceccomil Member Posts: 25
edited 2014-02-05 in NAV Three Tier
Hi everybody, I'm new in this forum. Really I'm new also in NAV...

Recently I tried to modify the report 206, for adding a company image but I can't understand why it doesn't work.

Really I saw that in report 206 depending on setting Sales setup the company logo should be visible at left, right or center, but unfortunately in my case wasn't visible.

By the way I cancelled the 3 picture box in the sections view and I have added a new picture box with source expression set to: MyCompInfo.Picture. In Globals I added a Variable called MyCompInfo based on record "Company Information".

On prereport I added "MyCompInfo.CALCFIELDS(Picture);"

Running report in classic version it's correct!

During design in VS2008 I added a textbox, in the body section, with value set to: "=System.Convert.ToBase64String(Fields!MyCompInfo_Picture.Value)"

Save
compile
and run... but instead of viewing report with a text box populated by the 64Basestring I saw a simple "#Error" ???

I hope any one can help me to understand why my Picture seems to be NULL...

Thanks in advance and sorry form my English!

Cecco

Comments

  • kinekine Member Posts: 12,562
    You need to read the record from database first... ;-) have you used MyCompInfo.GET before you call the CALCFIELDS? 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ceccomilceccomil Member Posts: 25
    Yes, I tried to put

    MyCompInfo.Get;
    MyCompInfo.CALCFIELDS(Picture);

    On both "OnPreReport" and "OnInitReport", but only in the Classic it works fine :(
  • clauslclausl Member Posts: 455
    1. In Classic client. Add PictureBox control in sections with DataSetFieldName=CompanyInfo_Picture.

    2. Select “View / Layout”

    3. Add textbox with following values in Body:
    Value: “=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)”
    Name: “CompanyPicture”
    Visibility Hidden: “True”
    Color: “Red”

    4. Add the following code to the Report properties.
    Shared PictureData as Object
    Public Function GetPicture() as Object
    Return PictureData
    End Function

    Public Function SetPicture(NewData as Object)
    if NewData>""
    PictureData = NewData
    end if
    End Function

    5. Add textbox to Page Header. Note! This textbox has to be placed above the Picture control added in next step.
    Value: “=Code.SetPicture(ReportItems!CompanyPicture.Value)”
    Visibility Hidden: “True”
    Color: “Red”

    6. Add picture control to Page Header with these Values
    Value: “=Convert.FromBase64String(Code.GetPicture())”
    Source: “Database”
    MIMEType: “image/bmp”

    7. Save and Compile
    8. Run report

    Regards,
    Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • ceccomilceccomil Member Posts: 25
    Hi Claus and thanks for your help, but unfortunately it doesn't work... :-(
    I don't know what is the problem, but I think it's appens before processing the report.
    If I leave Visibility.Hidden = false on TextBox "CompanyPicture" during the preview (instead of viewing the 64baseString with incomprensible ascii chars sequence) in the place where I puted the textBox appears an "#Error" string.


    If you want I can send you my report "206.fob"
    Best Regards

    Cecco
  • clauslclausl Member Posts: 455
    Yes please, I sent you my e-mail address in a private message.

    Regards,
    Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • clauslclausl Member Posts: 455
    After speaking with Cecco, I have realized that the guide I had on my blog for how to use the Picture stored in Company Information table, only worked in some case. So I have now updated the blog post with an updated "How to", that works for all sceanarios that I'm aware of.

    Please find the updated blog here: http://blogs.msdn.com/nav-reporting/archive/2009/02/05/how-to-add-a-company-picture-to-a-report.aspx

    Regards,
    Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • DenSterDenSter Member Posts: 8,307
    Speaking of the sales invoice report... Would it be possible to provide us with a complete tutorial about how to create this report from scratch? There's a pageloop, a copyloop, pictures, code behind the report, and other things. It would be a big help if we could understand how to make that work from start to finish, especially the connection between the C/SIDE report object and the RDLC layout. What do we need to do in the C/SIDE report, and what do we need to do in the RDLC, what is the correlation between the various elements.
  • ceccomilceccomil Member Posts: 25
    Thankyou Claus, tomorrow i'll check your new blog information.
    I think What DenSter says it's very interesting...

    Regards
    Cecco
  • Alex_ChowAlex_Chow Member Posts: 5,063
    DenSter wrote:
    Speaking of the sales invoice report... Would it be possible to provide us with a complete tutorial about how to create this report from scratch? There's a pageloop, a copyloop, pictures, code behind the report, and other things. It would be a big help if we could understand how to make that work from start to finish, especially the connection between the C/SIDE report object and the RDLC layout. What do we need to do in the C/SIDE report, and what do we need to do in the RDLC, what is the correlation between the various elements.

    I second this! =D>
  • TonyHTonyH Member Posts: 223
    I third! using the new report designer has been driving me bonkers!

    The new report design tool in VS is driving up the wall, and I can't find good documentation on it, anywhere. There are a few tutorials which are helpful, however nothing that covers enough basics in my opinion.

    So far its been trial and error.

    t
  • clauslclausl Member Posts: 455
    We currently working on a 2 days training course for our new reporting capabilties in NAV 2009.
    When the course is ready I will update this thread.

    Regards,
    Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • TonyHTonyH Member Posts: 223
    Thanks Claus, I think it safe to say that it will be well received...

    t
  • ceccomilceccomil Member Posts: 25
    =D> Great!

    Cecco
  • clauslclausl Member Posts: 455
    A 2 days training course, about our new Reporting capabilities, is now set to release to Partners Source on the 22nd of July 2009. I believe you should be able to download it when available.

    Regards,
    Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • aelmichsabaaelmichsaba Member Posts: 7
    as i think, if you follow that stapes correctly every thing including spelling on
    http://blogs.msdn.com/b/nav/archive/200 ... eport.aspx

    on the step 8
    8. Now lets add this to the report. We need to add the Company Picture first as a TextBox to the body of the report. This will enable us to use it in the Page Header. We add this Textbox in top of the Body.

    you will put not on the body simply you must create new raw above the existing row on the body and put that in the row. believe me it will work.

    you know the logic is correct that you add the code on the property window like "set" and "get" function. but why you see the X image inisted of the logo. that is you must put the text box inside the new row. ok =D>

    Michael B.
  • neddlemonneddlemon Member Posts: 2
    Hi! I realize you posted this a few years ago, but do you remember if you ever found a solution? I am new to NAV and I am also getting the same issue. The image isn't being displayed (red X instead) and the ToBase64String textbox shows "#Error" when it is visible. I followed the same tutorial and everything. Anything you remember would be great. Thanks!
  • neddlemonneddlemon Member Posts: 2
    Ok, well I found the solution with a coworker's help. If anyone else has this same problem and none of the other posts fix it, here is what I did:

    In the directions I followed (http://blogs.msdn.com/b/nav/archive/200 ... eport.aspx) it says:

    5. Now we should add a Picture Box on the Sections with SourceExpr: CompanyInfo.Picture.

    Since it didn't specify where to drop it in sections, I just dumped it in there randomly. Turns out that was my problem. Instead, we moved the picture box to the top of sections (if you look closely at the example, he puts it in the header). Problem solved!!
Sign In or Register to comment.