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?
0
Answers
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
What kind of variable do I need to add for this?
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.
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.
Take a look how it is donw in report 206
What do I write in the Setdata?
=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
Can you point me in the right direction to write the setdata?
I can check how your getdata should be from looking at it.
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)
Yes, that's why you need to encode to base64 from the report repeater.
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)
Put this as expression in the image control in the header, with image type bmp/jpg
Left is with convert 64 and right just the field.
Cheers!