Question

Hi I am new to the "SSRS" and web services i am trying to call the web service from the SSRS report.I have one web service which generates the barcode. I want the barcode to display in the report so i am calling the web service method from the ssrs.

The method is

[OperationContract]
Image BarcodeTextToImage(string value);

I am using the web service URL to call the method from the ssrs on the expression set to the image control as,

=Parameters!BarcodeURL.Value +"?value=" + CStr(Parameters!JobNumberFilter.Value)

where is BarcodeURL is set as

 http://localhost/barcode/DataMatrix.svc/BarcodeTextToImage

but i am not getting any output and getting two warnings as ,

1) [rsInvalidImageReference] The Value for the image ‘Image3’ is invalid. Details: The remote server returned an error: (400) Bad Request.
2) [rsInvalidExternalImageProperty] The value of the ImageData property for the image ‘Image3’ is “”, which is not a valid ImageData.

Now i tried changing the config file of web service to change it to webHttpBinding still same issue. Any links and answers will be great.

Was it helpful?

Solution

I have got same problem some time back so i got a work around for this problem i hope this will work for you too.

1) First i created the web app with the service reference of the created web service suppose Barcode39 is service so add the reference to the web application. 2) Then write the code behind using service client and call the method to create the barcode image in that code by passing the request variables values 3) Now give the link of that page as the URL to the image expression along with setting the image type as "EXTERNAL" and pass the values to the URL as request variables as

 "http:\\localhost:2310\BarcodeImage.aspx?data=" +(Parameters!YourParamtere.Value)

And one thing instead of returning the Image from the service try returning the byte array using stream and .ToArray() method that would be the best practice.Let me know if any problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top