Using the Customer Image on a report

midego
Member Posts: 51
Hello folks,
I have a customer card with an image on it. Table 18, field 140.
This field is a Media field, which works a bit different than the Picture field you were able to use before.
I can print the Image on an RDLC report when I load the field into the image box.
When I want to do it via the Setdata and Getdata the image does not display anymore.
I have searched on Google and what I find is that several developers are having issues with this, there is no solution that I can find.
Anyone here who has experience with this?
I have a customer card with an image on it. Table 18, field 140.
This field is a Media field, which works a bit different than the Picture field you were able to use before.
I can print the Image on an RDLC report when I load the field into the image box.
When I want to do it via the Setdata and Getdata the image does not display anymore.
I have searched on Google and what I find is that several developers are having issues with this, there is no solution that I can find.
Anyone here who has experience with this?
0
Answers
-
onaftergetrecord
TempBlob.blob.CREATEOUTSTREAM(Outs);
Customer.PICTURE.EXPORTSTREAM(Outs);
Then just put the TempBlob.Blob in the report where your mediafield now is.
I know.. why??. But it sure works the same as it used to
0 -
In the example, you provide you use the Customer.Picture, but this should be the image.
What kind of variable do I need to add for this?0 -
Yes, you're right. I was just being creative.
The code is written for a Media type field.
The blob is still in the customer table too, but that's not what we're talking about indeed.0 -
Unfortunately, it does not work as described above.
In de dataset the blob has an *, so it indicated that it is being filled, but it does not load with the Getdata in the RDLC.0 -
Ok, well then it probably is get and set data.
Take a look how it is donw in report 206
0 -
(so but a base64 string in the setdata, this probably works for update per customer)0
-
I have the following in the Expression.
What do I write in the Setdata?
0 -
Write the tobase64string code in the setdata function.
=convert.tobase64stiring(MyReportField)
And just do Getdata(x,x) as you're used to in the image control in the report header.
The picture box with mime type image/bmp wil create a jpg/bmp from the base64 string
it retreives from the getdata. So that is different from the example in report 206.
We're inventing this on the fly
0 -
Thanks for your help, I'm quite new at this.
Can you point me in the right direction to write the setdata?0 -
0 -
Setdata is done in a small hidden report control. Often situated behind the tablebox.0
-
I tried the above but I still don't get the images, unfortunately.
0 -
Can you post the entire content of the visibility property in plain text?
I can check how your getdata should be from looking at it.0 -
=
Cstr(Fields!ShipToAddr1.Value) + Chr(177) +
Cstr(Fields!ShipToAddr2.Value) + Chr(177) +
Cstr(Fields!ShipToAddr3.Value) + Chr(177) +
Cstr(Fields!ShipToAddr4.Value) + Chr(177) +
Cstr(Fields!ShipToAddr5.Value) + Chr(177) +
Cstr(Fields!ShipToAddr6.Value) + Chr(177) +
Cstr(Fields!ShipToAddr7.Value) + Chr(177) +
Cstr(Fields!ShipToAddr8.Value) + Chr(177) +
Cstr(Fields!SelltoCustNo_SalesShptHeader.Value) + Chr(177) +
Cstr(Fields!SalesPersonText.Value) + Chr(177) +
Cstr(Fields!ReferenceText.Value) + Chr(177) +
Cstr(Fields!SalesPurchPersonName.Value) + Chr(177) +
Cstr(Fields!YourRef_SalesShptHeader.Value) + Chr(177) +
Cstr(Fields!CompanyAddr1.Value) + Chr(177) +
Cstr(Fields!CompanyAddr2.Value) + Chr(177) +
Cstr(Fields!CompanyAddr3.Value) + Chr(177) +
Cstr(Fields!CompanyAddr4.Value) + Chr(177) +
Cstr(Fields!CompanyAddr5.Value) + Chr(177) +
Cstr(Fields!CompanyAddr6.Value) + Chr(177) +
Cstr(Fields!CompanyInfoPhoneNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoFaxNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoVATRegtnNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoGiroNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankName.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankAccountNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoHomePage.Value) + Chr(177) +
Cstr(Fields!CompanyInfoEmail.Value) + Chr(177) +
Cstr(Fields!SalesShptCopyText.Value) + Chr(177) +
Cstr(Fields!DocDate_SalesShptHeader.Value) + Chr(177) +
Cstr(Fields!No_SalesShptHeader.Value) + Chr(177) +
Cstr(Fields!ShptDate_SalesShptHeader.Value) + Chr(177) +
Cstr(Fields!SalesShptCopyText.Value) + Chr(177) +
Cstr(Fields!BankAccNoCaption.Value) + Chr(177) +
Cstr(Fields!BankNameCaption.Value) + Chr(177) +
Cstr(Fields!GiroNoCaption.Value) + Chr(177) +
Cstr(Fields!VATRegNoCaption.Value) + Chr(177) +
Cstr(Fields!PhoneNoCaption.Value) + Chr(177) +
Cstr(Fields!SelltoCustNo_SalesShptHeaderCaption.Value) + Chr(177) +
Cstr(Fields!ShipmentDateCaption.Value) + Chr(177) +
Cstr(Fields!ShipmentNoCaption.Value) + Chr(177) +
Cstr(Fields!HomePageCaption.Value) + Chr(177) +
Cstr(Fields!EmailCaption.Value) + Chr(177) +
Cstr(Fields!DocumentDateCaption.Value) + Chr(177) +
Convert.Tobase64string(Fields!TempBlob.Value)0 -
When I add a second image box and set the expression to =First(Fields!TempBlob.Value, "DataSet_Result") it does work. But this is not the way it should be if I want to print it in batch.0
-
It is not complete, I'm missing the setdata function at the beginning (I need that to know how to count)0
-
All the other field are working as they should?0
-
"When I add a second image box and set the expression to =First(Fields!TempBlob.Value, "DataSet_Result") it does work. But this is not the way it should be if I want to print it in batch."
Yes, that's why you need to encode to base64 from the report repeater.0 -
=Code.SetData(Cstr(Fields!CustAddr1.Value) + Chr(177) +
Cstr(Fields!CustAddr2.Value) + Chr(177) +
Cstr(Fields!CustAddr3.Value) + Chr(177) +
Cstr(Fields!CustAddr4.Value) + Chr(177) +
Cstr(Fields!CustAddr5.Value) + Chr(177) +
Cstr(Fields!CustAddr6.Value) + Chr(177) +
Cstr(Fields!CustAddr7.Value) + Chr(177) +
convert.tobase64stiring(MyReportField) + Chr(177) +
Cstr(Fields!BilltoCustNo_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!VATRegNo_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!YourReference_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!No_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!HdrOrderNo_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!PostingDate_SalesInvHdr.Value) + Chr(177) +
Cstr(Fields!DueDate_SalesInvHdr.Value) + Chr(177) +
Cstr(Cstr(Fields!PricesInclVATYesNo_SalesInvHdr.Value)) + Chr(177) +
Cstr(First(Fields!DocDate_SalesInvHdr.Value)) + Chr(177) +
Cstr(Fields!SalesPurchPersonName.Value) + Chr(177) +
Cstr(Fields!DocumentCaptionCopyText.Value) + Chr(177) +
Cstr(Fields!PaymentTermsDesc.Value) + Chr(177) +
Cstr(Fields!ShipmentMethodDesc.Value) + Chr(177) +
Cstr(Fields!CompanyAddr1.Value) + Chr(177) +
Cstr(Fields!CompanyAddr2.Value) + Chr(177) +
Cstr(Fields!CompanyAddr3.Value) + Chr(177) +
Cstr(Fields!CompanyAddr4.Value) + Chr(177) +
Cstr(Fields!CompanyAddr5.Value) + Chr(177) +
Cstr(Fields!CompanyAddr6.Value) + Chr(177) +
Cstr(Fields!CompanyInfoPhoneNo.Value) + Chr(177) +
Cstr(Fields!OrderNoText.Value) + Chr(177) +
Cstr(Fields!EMail.Value) + Chr(177) +
Cstr(Fields!HomePage.Value) + Chr(177) +
Cstr(Fields!CompanyInfoVATRegNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoGiroNo.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankName.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankAccNo.Value) + Chr(177) +
Cstr(Fields!PricesInclVAT_SalesInvHdrCaption.Value) + Chr(177) +
Cstr(Fields!InvNoCaption.Value) + Chr(177) +
Cstr(Fields!SalesInvPostingDateCptn.Value) + Chr(177) +
Cstr(Fields!BilltoCustNo_SalesInvHdrCaption.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankAccNoCptn.Value) + Chr(177) +
Cstr(Fields!CompanyInfoBankNameCptn.Value) + Chr(177) +
Cstr(Fields!CompanyInfoGiroNoCaption.Value) + Chr(177) +
Cstr(Fields!CompanyInfoVATRegNoCptn.Value) + Chr(177) +
Cstr(Fields!CompanyInfoPhoneNoCaption.Value) + Chr(177) +
Cstr(Fields!PageCaption.Value) + Chr(177) +
Cstr(Fields!ReferenceText.Value) + Chr(177) +
Cstr(Fields!SalesPersonText.Value) + Chr(177) +
Cstr(Fields!VATNoText.Value) + Chr(177) +
Cstr(Fields!SalesInvDueDateCaption.Value) + Chr(177) +
Cstr(Fields!DocumentDateCaption.Value) + Chr(177) +
Cstr(Fields!PaymentTermsDescCaption.Value) + Chr(177) +
Cstr(Fields!ShptMethodDescCaption.Value) + Chr(177) +
Cstr(Fields!EMailCaption.Value) + Chr(177) +
Cstr(Fields!HomePageCaption.Value)
, 1)0 -
Code.Getdata(1,8) is where my picture is, encode in base 64
Put this as expression in the image control in the header, with image type bmp/jpg0 -
Unfortunately, I still don't get the image.
Left is with convert 64 and right just the field.
0 -
I changed the expression in the image to =Convert.FromBase64String and now it is working.0
-
yes! thats it0
-
Thanks for the help
Cheers!0 -
You're welcome0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions