what is the best way to troubleshoot when your datasource isn't working?
The Fields in the datasource just don't show up when trying to access them. I need to pull data from an Entity Framework data source.
In the code below, I put everything into a simple class, like your Cars example.
I have created an ObjectDataSource which uses the call to Submissions.GetSubmissions(). I have assigned this datasource to the Report and an embedded list Everything compiles without errors, but when I try to set a textbox to a field value, I don't see any fields, I just see, "No datasource".
I am using the newly released 2010 version of Telerik Reporting in Visual Studio 2008.
Suggestions?
Is there a walk through that I should be using?
Thanks,
- Daniel
The Fields in the datasource just don't show up when trying to access them. I need to pull data from an Entity Framework data source.
In the code below, I put everything into a simple class, like your Cars example.
I have created an ObjectDataSource which uses the call to Submissions.GetSubmissions(). I have assigned this datasource to the Report and an embedded list Everything compiles without errors, but when I try to set a textbox to a field value, I don't see any fields, I just see, "No datasource".
I am using the newly released 2010 version of Telerik Reporting in Visual Studio 2008.
Suggestions?
Is there a walk through that I should be using?
Thanks,
- Daniel
using System; |
using System.Collections; |
using System.Collections.Generic; |
using System.Configuration; |
using System.Linq; |
using System.Text; |
using DatabaseLayer; |
using log4net; |
namespace PCIIReports |
{ |
public class RSubmission |
{ |
private Guid _submissionID; |
private string _cikrName; |
private string _cikrCountry; |
private string _cikrState; |
public RSubmission() { } |
public RSubmission(Guid submissionId, String cikrName, string cikrCountry, string cikrState) |
{ |
_submissionID = submissionId; |
_cikrName = cikrName; |
_cikrCountry = cikrCountry; |
_cikrState = cikrState; |
} |
public Guid SubmissionId |
{ |
get { return _submissionID; } |
set { _submissionID = value; } |
} |
public String CIKRName |
{ |
get { return _cikrName; } |
set { _cikrName = value; } |
} |
public String CIKRCountry |
{ |
get { return _cikrCountry; } |
set { _cikrCountry = value; } |
} |
public String CIKRState |
{ |
get { return _cikrState; } |
set { _cikrState = value; } |
} |
} |
public class Submissions |
{ |
private static readonly ILog Log = |
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
static string GetConnectionStringByName(string name) |
{ |
// Assume failure. |
string returnValue = null; |
// Look for the name in the connectionStrings section. |
ConnectionStringSettings settings = |
ConfigurationManager.ConnectionStrings[name]; |
// If found, return the connection string. |
if (settings != null) |
returnValue = settings.ConnectionString; |
return returnValue; |
} |
public Submissions() |
{ |
} |
public List<RSubmission> GetSubmissions() |
{ |
var connectionString = GetConnectionStringByName("pciidbContext"); |
var context = new pciidbContext(connectionString); |
var query = |
from submission in |
context.Submissions.Include("Submitter").Include("OnBehalfOf").Include("Documents").ToList() |
select new RSubmission |
{ |
SubmissionId = submission.SubmissionId, |
CIKRName = submission.CriticalInfrastructureKey == null ? "Unknown" : submission.CriticalInfrastructureKey.Name, |
CIKRCountry = submission.CIKRCountry, |
CIKRState = submission.CIKRStateAbbr |
}; |
return query.ToList(); |
} |
} |
} |