<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExportListUserControl.ascx.cs" Inherits="CADLibraryWebPart.ExportList.ExportListUserControl" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2012.2.815.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<div style="height: 500px;">
<telerik:ReportViewer ID="ReportViewer1" runat="server" style="border:1px solid #ccc;" width="99%" height="99%"></telerik:ReportViewer>
</div>
private DataTable createData()
{
DataSet ds = new DataSet();
ds.Tables.Add();
DataTable table = ds.Tables[0];
int columnCount = 3;
int rowCount = 1000;
//Add columns
for (int column = 0; column <= columnCount - 1; column++)
{
table.Columns.Add("Column" + (column + 1).ToString(), typeof(string));
}
//Add rows
for (int row = 0; row <= (rowCount - 1); row++)
{
string[] rowVals = (string[])Array.CreateInstance(typeof(string), columnCount);
DataRowCollection rowCollection = table.Rows;
for (int column = 0; column <= columnCount - 1; column++)
{
rowVals[column] = "value_" + (column + 1).ToString() + "_" + (row + 1).ToString();
}
table.Rows.Add(rowVals);
}
return ds.Tables[0];
}
private void BindTelerikReport()
{
// Creating and configuring the ObjectDataSource component:
var objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = createData(); // GetData(); // GetData returns a DataSet with three tables
// Creating a new report
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
// Assigning the ObjectDataSource component to the DataSource property of the report.
report.DataSource = objectDataSource;
// Use the InstanceReportSource to pass the report to the viewer for displaying
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;
// Assigning the report to the report viewer.
ReportViewer1.ReportSource = reportSource;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindTelerikReport();
}
}
I would appreciate any help with this. Thanks you!
Hello Telerik Team,
I am presently converting my crystal reports to telerik reports.But previously crystal reports datasource was sql stored procedures and select statements but now
I am planning to have a datasource as sharepoint list.Is there any sample on how we can do that.
I appreciate your help.
Look forward from you.
Thank you
Smith
Me
.ProidersSubReport.ReportSource =
Me
.ReportFamiliesDetailProviderSub1
objectDataSource.Parameters.Add(new Telerik.Reporting.ObjectDataSourceParameter("productModelID", typeof(int), 23));