Hi,
I have created trdx file from telerik Report designer and I have added a table layout with columns from sql datasource now I want to access it my ASP.NEt application there I have used this code
var settings = new System.Xml.XmlReaderSettings();
settings.IgnoreWhitespace = true;
using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create("C:\\Lisensining\\Report1.trdx", settings))
{
var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
var reportDocument = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
var reportSource = new InstanceReportSource();
reportSource.ReportDocument = reportDocument;
SqlConnectionStringBuilder scsb = new SqlConnectionStringBuilder();
scsb.UserID = "sa";
scsb.Password = "root";
scsb.InitialCatalog = DataBaseName;
scsb.DataSource = SErverName;
Telerik.Reporting.SqlDataSource sds = (Telerik.Reporting.SqlDataSource)reportDocument.DataSource;
if (sds != null)
sds.ConnectionString = scsb.ConnectionString;
this.SetConnectionString(reportDocument.Items, connectionString);
this.ReportViewer1.ReportSource = reportSource;
this.ReportViewer1.RefreshReport();
}
It is working great and showing all the records from database table but as I add filters to code report does not show any record
Telerik.Reporting.Filter filter1 = new Filter("Fields.[ProductName]", FilterOperator.Equal, "Vista");
reportDocument.Filters.Add(filter1);
Now report viewer does not show any thing :(