Filter filter1 = new Filter();filter1.Expression = "=Fields.DAYNUMBER";filter1.Operator = FilterOperator.TopN;filter1.Value = "1";this.table2.RowGroups[0].ChildGroups[1].Filters.Add(filter1);Dim report1 As New myReports.ProjectListDim tbl As DataTable = db.ExecuteDataTable("SELECT * FROM mydata WHERE ProgramID = " & nProgramID)report1.DataSource = tblReportViewer1.Report = report1Dim report1 As New myReports.ProjectListDim tbl As DataTable = db.ExecuteDataTable("SELECT * FROM mydata WHERE ProgramID = " & nProgramID)report1.DataSource = tblDim instanceReportSource As New Telerik.Reporting.InstanceReportSource()instanceReportSource.ReportDocument = report1ReportViewer1.ReportSource = instanceReportSourceHi
I’m new the Telerik Reporting and I’m having an issue with the report viewer in my windows form project that I’m a bit stumped on.
When I run the form I need to hit the refresh button or the viewer is blank.
I followed this quick start guide…
http://www.telerik.com/help/reporting/quick-start-windows-viewer.html
… and as far as I’m aware I have not missed anything.
To me it seems like the RefreshReport method is not being called but I’m not sure.
I went through the motions for two separate projects and ran into the same problem.
I realize that this is not much to go on but I don’t know what else I can say.
1、Create Self-Host Report WcfService
------------------------------------------------------------------------------------------------
WCFService Library Application:WCF Service Library Project
------------------------------------------------------------------------------------------------
ReportLibrary.ReportService.cs
namespace ReportLibrary { [System.Runtime.Serialization.KnownType(typeof(object[]))] public class ReportService : Telerik.Reporting.Service.ReportServiceBase { private static readonly Uri baseUri = new Uri("http://localhost:9009/Telerik/ReportService/"); protected override Uri BaseAddress { get { return baseUri; } } } } app.config
<!-- Telerik.Reporting.Service.IReportService --> <service name="ReportLibrary.ReportService" behaviorConfiguration="serviceBehavior"> <host> <baseAddresses> <add baseAddress="http://localhost:9002/Telerik/ReportService/"/> </baseAddresses> </host> <endpoint address="" binding="customBinding" bindingConfiguration="WcfServiceCustomBinding0" contract="Telerik.Reporting.Service.IReportService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="ResourceService" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IResourceService"/> <endpoint address="ClientAccessPolicy" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IClientAccessPolicy"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> Build Success And Output:
ReportLibrary\bin\Debug\ReportLibrary.dll
ReportLibrary\bin\Debug\Telerik.Reporting.Service.dll
------------------------------------------------------------------------------------------
WcfHost Console Application:WCF Self-Host Console Project
------------------------------------------------------------------------------------------
WcfHost.Program.cs
namespace WcfHost { public class Program { public static void Main(string[] args) { ServiceHost hostA = null; ServiceHost hostDomain = null; try { hostA = new ServiceHost(typeof(ReportLibrary.ReportService)); hostDomain = new ServiceHost(typeof(DomainService)); hostA.Open();hostDomain.Open(); Console.WriteLine("Report Services is starting..."); Console.WriteLine("CrossDomain Service is starting..."); Console.WriteLine(); Console.WriteLine("Press <ENTER> to terminate host"); Console.ReadLine(); hostA.Close(); hostDomain.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } finally { hostA.Close(); } } } } app.config
<service behaviorConfiguration="serviceBehavior" name="ReportLibrary.ReportService"> <host> <baseAddresses> <add baseAddress="http://localhost:9002/Telerik/ReportService/" /> </baseAddresses> </host> <endpoint address="" binding="customBinding" bindingConfiguration="WcfServiceCustomBinding0" contract="Telerik.Reporting.Service.IReportService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="ResourceService" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IResourceService"/> <endpoint address="ClientAccessPolicy" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IClientAccessPolicy"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> Build Success And Output:
WcfHost\bin\Debug\ReportLibrary.dll
WcfHost\bin\Debug\Telerik.Reporting.Service.dll
WcfHost\bin\Debug\WcfHost.exe
Run WcfHost.exe Carrying ReportLibrary.ReportService Wcf Service;
service endpoint Address = "http://localhost:9002/Telerik/ReportService/"; by normal browser access wcf service
2、Create Wcf Client
------------------------------------------------------------------------------------------------------
ReportSLApp Silverlight Application:Wcf Silverlight Client Project
Add Reference:Reporting Q1 2011\bin\Telerik.ReportViewer.Silverlight.dll;
------------------------------------------------------------------------------------------------------
ServiceReferences.ClientConfig
<endpoint address="http://localhost:9002/Telerik/ReportService/" binding="customBinding" bindingConfiguration="CustomBinding_IReportService" contract="ReportServiceRef1.IReportService" name="CustomBinding_IReportService" /> ReportSLApp.MainPage.xaml.cs
private void UserControl_Loaded(object sender, RoutedEventArgs e) { ServiceClient = new ReportServiceRef1.ReportServiceClient("CustomBinding_IReportService"); ServiceClient.ListAvailableReportsCompleted += new EventHandler<ReportServiceRef1.ListAvailableReportsCompletedEventArgs>(ServiceClient_ListAvailableReportsCompleted); ServiceClient.ListAvailableReportsAsync(); this.rptViewer1.ReportServiceUri = ServiceClient.Endpoint.Address.Uri; } private void ServiceClient_ListAvailableReportsCompleted(object sender,
ReportServiceRef1.ListAvailableReportsCompletedEventArgs e) { if (e.Error == null) { MyReports = e.Result; this.rptViewer1.Report = MyReports[0].FullName; } } Build Success And Browse Silverlight HostPage:
ReportSLAppTestPage.aspx error occurred operating results; Silverlight ReportViewer InnerException
I urgently need help, wait ...