Syncfusion Silverlight Report Viewer -
i trying use sync fusions report viewer silver light export report pdf, if set report processingmode.local report renders data if switch processingmode.remote , use wcf service syncfusion says use, reports not rendering data.
to add complication using domain service can mix wcf , ria-domain services.
this test project make sure can want in our silverlight app developing.
silverlight code:
dim test new reportapp.reporttest.testreportserver dim staff new list(of salesperson) dim storedsiteurl string = "" 'dim data ilist(of salesperson) public sub new() initializecomponent() end sub private sub mainpage_loaded(sender object, e system.windows.routedeventargs) handles me.loaded me.test.load(me.test.getstaffquery, addressof getrecords, false) private sub displayreort(e invokeoperation(of byte())) dim rdlstream1 stream = new memorystream(e.value) dim r new reportdatasource dim serviceurl string = "" dim hostname string = application.current.host.source.host if application.current.host.source.port <> 80 hostname += ":" + application.current.host.source.port.tostring end if serviceurl = (convert.tostring("http://") & hostname) + "/reportingservice.svc" r.name = "salesperson" r.value = staff 'reportviewer1.processingmode = processingmode.local reportviewer1.processingmode = processingmode.remote reportviewer1.reportserviceurl = serviceurl try reportviewer1.datasources.clear() reportviewer1.loadreport(rdlstream1) reportviewer1.datasources.add(r) 'reportviewer1.datasources.add(new reportdatasource {.name = "salesperson", .value = staff}) reportviewer1.refreshreport() catch ex exception messagebox.show(ex.tostring) end try end sub private sub getrecords(loadop servicemodel.domainservices.client.loadoperation(of salesperson)) 'throw new notimplementedexception staff = loadop.entities.tolist datagrid1.itemssource = staff test.getreport(addressof displayreort, nothing) end sub end class
domain service code:
private staff list(of salesperson) private function getserverrootpath() string dim r string = httpcontext.current.server.mappath("..") if r.endswith("\") = false r &= "\" return r end function <invoke()> public function getreport() byte() dim b byte() dim ff new filefunctions.filefunctions if ff.filefound(getserverrootpath() & "reports\report1.rdlc") = true debug.print("file found!") else debug.print("file not found!") end if b = ff.readfiletobyte(getserverrootpath() & "reports\report1.rdlc") if b.length <= 0 debug.print("array 0 length!") return b end function '<invoke()> 'public function getreportdatasource() reportdatasource ' dim r new reportdatasource ' dostaff() ' r.name = "salesperson" ' r.value = staff.tolist ' return r 'end function private sub dostaff() dim tempstaff new salesperson staff = new list(of salesperson) tempstaff.id = 0 tempstaff.fullname = "jason smith" tempstaff.title = "sales representative" tempstaff.salesterritory = "northeast" tempstaff.id2002 = "1375876.8256" tempstaff.id2003 = "40" tempstaff.id2004 = "4557045.0459" staff.add(tempstaff) end sub public function getstaff() ienumerable(of salesperson) dostaff() return staff end function <invoke()> public sub updatestaff(s salesperson) debug.print(s.id.tostring) end sub any 1 idea.
Comments
Post a Comment