Hello.
There is problem with dynamic creation of table columns in MVC Report. Situation is in the following.
In my Report.cs file I override OnNeedDataSource() method. In it I create System.Data.DataTable, then attach this DataTable to Telerik's table as DataSource.
Code for this methods:
/// <summary>
/// Creates DataTable from ReportRecords
/// </summary>
/// <param name="data">List of ReportRecords</param>
/// <returns>DataTable filled with ReportRecord's values</returns>
private System.Data.DataTable CreateDataTable(List<ReportRecord> data)
{
System.Data.DataColumn currentColumn = new System.Data.DataColumn("Current", typeof(int));
System.Data.DataColumn lateColumn = new System.Data.DataColumn("Late", typeof(int));
System.Data.DataColumn foreignColumn = new System.Data.DataColumn("Foreign", typeof(int));
System.Data.DataTable table = new System.Data.DataTable("table");
table.Columns.AddRange(new System.Data.DataColumn[] { currentColumn, lateColumn, foreignColumn });
foreach (ReportRecord reportRecord in data)
{
System.Data.DataRow row = table.NewRow();
row["Current"] = reportRecord.Current;
row["Late"] = reportRecord.Late;
row["Foreign"] = reportRecord.Foreign;
table.Rows.Add(row);
}
return table;
}
/// <summary>
/// Assign DataTable as DataSource of dinamically created table in report
/// </summary>
/// <param name="table">DataTable with data to display</param>
private void AddTableToReport(System.Data.DataTable table)
{
this.tableMain.DataSource = table;
//create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
Telerik.Reporting.TextBox textboxGroup;
Telerik.Reporting.TextBox textBoxTable;
//we do not clear the Rows collection, since we have a details row group and need to create columns only
this.tableMain.ColumnGroups.Clear();
this.tableMain.Body.Columns.Clear();
this.tableMain.Body.Rows.Clear();
int i = 0;
this.tableMain.ColumnHeadersPrintOnEveryPage = true;
foreach (System.Data.DataColumn dc in table.Columns)
{
Telerik.Reporting.TableGroup tableGroup = new Telerik.Reporting.TableGroup();
Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
tableGroup.ChildGroups.Add(tableGroup2);
this.tableMain.ColumnGroups.Add(tableGroup);
this.tableMain.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
textboxGroup = new Telerik.Reporting.TextBox();
textboxGroup.Style.BorderColor.Default = Color.Black;
textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
textboxGroup.Value = dc.ColumnName;
textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
tableGroup.ReportItem = textboxGroup;
textBoxTable = new Telerik.Reporting.TextBox();
textBoxTable.Style.BorderColor.Default = Color.Black;
textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
textBoxTable.Value = "=Fields." + dc.ColumnName;
textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
this.tableMain.Body.SetCellContent(0, i++, textBoxTable);
this.tableMain.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
}
}
But, as result, I achieve values from first colum of my DataTable in every column of my Telerik's table:
Current Late Foreign
0 0 0
20 20 20
1 1 1
21 21 21
4 4 4
But values should be the following:
Current Late Foreign
0 0 1
20 1 0
1 0 6
21 0 0
4 1 0
Why this happens and how to solve the situation?

I'm working on a proof of concept using Telerik Reporting. The requirements are that the report be loaded from an XML source and provide that report with data via a DataTable (from the System.Data namespace). The problem is that my data isn't showing up in my report. The generated report has table in it and it has the right number of rows but there is no information in any of the rows. Below is a copy of the code I'm using to generate the report:
XmlReaderSettings settings = new XmlReaderSettings{ IgnoreWhitespace = true};using (StringReader sr = new StringReader(template.Layout)) //template.Layout contains a string which is the report XMLusing (XmlReader xmlReader = XmlReader.Create(sr, settings)){ ReportXmlSerializer xmlSerializer = new ReportXmlSerializer(); TelerikReport reportInstance = (TelerikReport)xmlSerializer.Deserialize(xmlReader); DataSet data = BuildDataSet(template, parameters); //Retreives the data from the database in a DataSet ObjectDataSource dataSource = new ObjectDataSource { DataSource = data.Tables[0] }; reportInstance.DataSource = dataSource; return reportInstance;}The XML for the report (and the value of template.Layout) can be found here. The generated PDF shows 3 rows which is the same number of rows that the DataTable has. That means the DataTable is being read correctly but the data isn't getting parsed correctly for some reason. If I can get this working it would make Telerik the prime candidate for the final version of the software.

Telerik.Reporting.UriReportSource ur = new Telerik.Reporting.UriReportSource();ur.Uri = "trpt01.cs";rptview.ReportSource = ur;rptview.RefreshReport();Hi Guys,
I have created a class library for reporting only and used telerik.reporting version 10.2.16.914 in my Class library(myReportingDLL). I referenced my Class Library (myReportingDLL) to a Web Project and Web project have telerik.reporting version 10.1.16.504.
Previously, Web project not giving any error and report runs but now it is giving an error;
"could not load file or assembly 'telerik.reporting, version=10.2.16.914, culture=neutral, publickeytoken=a9d7983dfcc261be' or one of its dependencies. the located assembly's manifest definition does not match the assembly reference. (exception from hresult: 0x80131040)"
Please advise.
Type mismatch in function arguments. Cannot find an overload of the function Join() that accepts arguments of type (String, String).

Hi,
I'm using Visual Studio 2015 w/Telerik R1 2017 & SQL Server 2012.
Having a strange issue when configuring a report source.
1. Under Configure data connection choose an existing (good) data connection.
2. Click next and select 'Use as Shared Connection'
3. Click next and enter my SQL statement. The first statement is an @declare. Followed by some select statements to get the data. It's a fairly simple 6-table join (works in SSMS).
4. Open the query builder. Gives message 'The Declare SQL construct or statement is not supported.' Click Ok and then Execute Query. The same records are returned as when running the query in SSMS.
5. After configuring the data source and design time parameters I get to the preview screen.
6. Click Execute Query. Get message 'The variable name @CustomerNumber' has already been declared...' It's using the same parameters as step 4.
Questions:
In step #4 the SQL query runs in spite of the message 'The Declare SQL construct...'. Does this mean the query is Ok or not? If not Ok then why is data returned from the query builder? The SQL is valid in SSMS so I would expect the same to be used when in the designer. The message 'The Declare SQL construct...' is troubling as this is a normal part of SQL Server. So does the Telerik designer support the FULL implementation of SQL Server?
In step #6 the error message is misleading. The variable is only declared one time. How can I get past the error message?
Thanks,
Jim B