TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rohit Sharma
NA
100
44.8k
Bind Crystal Report though Dynamic DataTable.
Sep 20 2012 3:53 AM
Hello sir
when i bind a crystal report through dynamic datatable then i get an error "a number field or currency amount field is required here"
my datatable like this
//////////////
sqlSelect = "select AI_PerEntry_ID,AI_Center_Name,AI_District,AI_Date,AI_Fresh_No_Of_Bull,AI_Repeat_No_Of_Bull,AI_Male_Calf,AI_Female_Calf,AI_Type from tbl_PerformanceEntry where AI_Type='" + type + "'";
dt = cls.FetchDataTable(sqlSelect);
DataTable table = new DataTable("AI_Performance");
DataColumn column = new DataColumn("id");
DataColumn column2 = new DataColumn("Center");
DataColumn column3 = new DataColumn("District");
DataColumn column4 = new DataColumn("No_of_Fresh");
DataColumn column5 = new DataColumn("No_of_Repeat");
DataColumn column6 = new DataColumn("Totle_Insemination");
DataColumn column7 = new DataColumn("Calf_Birth(M/F)");
table.Columns.Add(column);
table.Columns.Add(column2);
table.Columns.Add(column3);
table.Columns.Add(column4);
table.Columns.Add(column5);
table.Columns.Add(column6);
table.Columns.Add(column7);
for (int i = 0; i < dt.Rows.Count; i++)
{
int Id = Convert.ToInt32(dt.Rows[i][0]);
string center = dt.Rows[i][1].ToString();
string district = dt.Rows[i][2].ToString();
int f = Convert.ToInt32(dt.Rows[i][4]);
int r = Convert.ToInt32(dt.Rows[i][5]);
int c = (f + r);
if (dt.Rows[i][6] == DBNull.Value || dt.Rows[i][7] == DBNull.Value)
{
MC = 0;
FC = 0;
}
else
{
MC = Convert.ToInt32(dt.Rows[i][6]);
FC = Convert.ToInt32(dt.Rows[i][7]);
}
DataRow row = table.NewRow();
row["id"] = Id;
row["Center"] = center;
row["District"] = district;
row["No_of_Fresh"] = f;
row["No_of_Repeat"] = r;
row["Totle_Insemination"] = c;
row["Calf_Birth(M/F)"] = MC + " / " + FC;
table.Rows.Add(row);
}
AI_Performance aiperformance = new AI_Performance();
aiperformance.dtr = table;
aiperformance.Show();
/////////////////////////
can you tell me how to solve this error "a number field or currency amount field is required here".
i am very thankful to you.
Reply
Answers (
0
)
text boxes enabled property not working
Any advice on how it is done?