Hi,
I'm with this problem in a report that I am unable to solve the problem
I have these command gives the error and where this is
protected void Form1_LoadCompleted_1()
{
try
{
System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
settings.IgnoreWhitespace = true;
System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(this.MapPath("Rel_proposta_teste.trdx"), settings);
Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
Rel.SetReportConnectionString(report, Convert.ToString(((Databases)Application["Databases"]).DataBaseList["Bdescala"].StringConnection)); <<<here problem>>>
report.ReportParameters["Param_idproposta"].Value = Param_idproposta_inicio;
// Atenção = altere o parâmetro “pld_entidade” para o parâmetro que vc criou no Reporting Telerik.
this.ReportViewer1.ReportSource = new Telerik.Reporting.InstanceReportSource
{
ReportDocument = report,
};
}
catch (Exception ex)
{
labError.Text = ex.Message.ToString();
}
}
public partial class Rel : System.Web.UI.Page
{
public static void SetReportConnectionString(Telerik.Reporting.Report reportDocument, String connectionString)
{
Telerik.Reporting.SqlDataSource sds = (Telerik.Reporting.SqlDataSource)reportDocument.DataSource;
if (sds != null)
sds.ConnectionString = connectionString;
SetReportConnectionString(reportDocument.Items, connectionString);
}
public static void SetReportConnectionString(Telerik.Reporting.ReportItemBase.ItemCollection items, String connectionString)
{
foreach (Telerik.Reporting.ReportItemBase ib in items)
{
if (ib.Items != null)
{
SetReportConnectionString(ib.Items, connectionString);
}
Type type = ib.GetType();
System.Reflection.PropertyInfo dataSourceProperty = type.GetProperty("DataSource");
if (dataSourceProperty == null)
continue;
var dataSource = dataSourceProperty.GetValue(ib, null) as Telerik.Reporting.SqlDataSource;
dataSource.ConnectionString = connectionString;
}
}
}
The report is attached
thank you
NIgri
I'm with this problem in a report that I am unable to solve the problem
I have these command gives the error and where this is
protected void Form1_LoadCompleted_1()
{
try
{
System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
settings.IgnoreWhitespace = true;
System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(this.MapPath("Rel_proposta_teste.trdx"), settings);
Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
Rel.SetReportConnectionString(report, Convert.ToString(((Databases)Application["Databases"]).DataBaseList["Bdescala"].StringConnection)); <<<here problem>>>
report.ReportParameters["Param_idproposta"].Value = Param_idproposta_inicio;
// Atenção = altere o parâmetro “pld_entidade” para o parâmetro que vc criou no Reporting Telerik.
this.ReportViewer1.ReportSource = new Telerik.Reporting.InstanceReportSource
{
ReportDocument = report,
};
}
catch (Exception ex)
{
labError.Text = ex.Message.ToString();
}
}
public partial class Rel : System.Web.UI.Page
{
public static void SetReportConnectionString(Telerik.Reporting.Report reportDocument, String connectionString)
{
Telerik.Reporting.SqlDataSource sds = (Telerik.Reporting.SqlDataSource)reportDocument.DataSource;
if (sds != null)
sds.ConnectionString = connectionString;
SetReportConnectionString(reportDocument.Items, connectionString);
}
public static void SetReportConnectionString(Telerik.Reporting.ReportItemBase.ItemCollection items, String connectionString)
{
foreach (Telerik.Reporting.ReportItemBase ib in items)
{
if (ib.Items != null)
{
SetReportConnectionString(ib.Items, connectionString);
}
Type type = ib.GetType();
System.Reflection.PropertyInfo dataSourceProperty = type.GetProperty("DataSource");
if (dataSourceProperty == null)
continue;
var dataSource = dataSourceProperty.GetValue(ib, null) as Telerik.Reporting.SqlDataSource;
dataSource.ConnectionString = connectionString;
}
}
}
The report is attached
thank you
NIgri