Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Reports with WCF webservice as datasource

I have two following objects: Assignment and Billing

enter image description here The GetAssignments method returns a list of Assignments and what I want is to get a Billing for every Assignment. GetBillingByAssignmentId takes an integer AssignmentId as parameter.

From what I have read from different sources is that its not supported by the CR. Therefore I Changed the GetBillingByAssignmentId to take list of integers as parameter.

Now the problem is how do I pass a list of integers as parameter to GetBillingByAssignmentId from CrystalReports.

Is it even doable? If so then please do point me in the right direction.

like image 975
Hassan Ata Ullah Avatar asked Jan 09 '17 13:01

Hassan Ata Ullah


1 Answers

No feedback recieved so I came up with a work around to midigate my Problem. Its not an elegant solution but it works.

First I concatenated The Assignment and the Billing Objects into one Master object so that all information is contained in one object called Assignment.

Secondly I changed the parameter of the GetAssignments method to take a string and not List of integers. And then from Crystal reports viewer when user is prompted for a value the user can type comma seperated list of Assignment Ids. The web service splits the Assignmend Ids and returns the List of Assignment objects.

The 'Allow multiple values' option in Edit parameter window in crystal reports viewer is greyed out and is not supported/always false when using webservices as datasource.

like image 77
Hassan Ata Ullah Avatar answered Nov 19 '22 10:11

Hassan Ata Ullah