This is a migrated thread and some comments may be shown as answers.

Error while Processing the Report

7 Answers 229 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tejas
Top achievements
Rank 1
Tejas asked on 24 Apr 2009, 01:27 PM
Hi All,
We are designing an report which uses storeprocedure to fetch data from database,We created one dataset which get correctly filled
with data (we confirm It by using viewdata tool),however during rendering  it gives following error,

An error has occured while processing Report '':
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Same storeprocedure we are using with RDLC report which is working fine.

Please suggest,
Thanks,
Tejas.

7 Answers, 1 is accepted

Sort by
0
Tejas
Top achievements
Rank 1
answered on 25 Apr 2009, 04:49 AM
Do you need any more information?
0
Steve
Telerik team
answered on 27 Apr 2009, 10:16 AM
Hi Tejas,

Unfortunately we would need more information (how and where do you bind your report) or best a sample project that shows the problem at hand. In case you have not reviewed this KB article, please check it out.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Tejas
Top achievements
Rank 1
answered on 28 Apr 2009, 10:49 AM

Hi Here is the code where I bind datasource to the report.I have already developed some reports with same steps are working fine.

namespace

ReportClassLibrary  

 

using System;  

 

using System.ComponentModel;  

 

using System.Drawing;  

 

using System.Windows.Forms;  

 

using Telerik.Reporting;  

 

using Telerik.Reporting.Drawing;  

 

/// <summary>  

 

/// Summary description for ReportABCD.  

 

/// </summary>  

 

public partial class ReportABCD : Telerik.Reporting.Report  

 

public ReportABCD()  

 

/// <summary>  

 

/// Required for telerik Reporting designer support  

 

/// </summary>  

 

InitializeComponent(); 

this.DataSource = null;  

 

//  

 

// TODO: Add any constructor code after InitializeComponent call  

 

//  

 

private void ReportABCD_NeedDataSource(object sender, EventArgs e)  

{

DataSetABCDTableAdapters.

 

MTS_spForPhone_HeadCountTableAdapter tbAdapter =  

 

new ReportClassLibrary.DataSetABCDTableAdapters.MTS_spForPhone_HeadCountTableAdapter();  

Telerik.Reporting.Processing.

 

Report report = (Telerik.Reporting.Processing.Report)sender;  

report.DataSource = tbAdapter.GetData(2006, 2008);

}

}

}

 

0
Steve
Telerik team
answered on 29 Apr 2009, 12:16 PM
Hi Tejas,

Your code is correct and the fact that it works fine on other reports only confirms this. We're afraid that unless you provide us with a working report that exhibits the error you've encountered, we would not be of much help. You can do this by providing us with a link to a sample project here or open a support ticket and attach it to it.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
nilesh
Top achievements
Rank 1
answered on 14 Dec 2009, 11:12 AM
Hello telerik


 I Have Same Problem as tejas 
pls reply early as possible And Ur suggested link Can`nt open

Thanks 
Nilesh Patel 
0
Shannon
Top achievements
Rank 1
answered on 04 Sep 2012, 07:33 PM
Old thread, but I'm able to generate this error using Telerik Reporting Q2 (6.1.12.820).

Every time I run across this error, it is because there is something wrong with a Table Adapter.  

I populate my report using an objectdatasource that has its DataSource equal to a WCF service call that returns a data table.  For the service calls that resulted in this error, I debugged and noticed the call would fail to return from the service - I could hit the service call line, but debugging would break and never hit the next line and the report viewer would show the violating error.

Researching led me to the table adapter (on the WCF service side) I was filling during the service call.  There was always something set wrong for a column's properties in the table adapter.  

If you come across this problem, I recommend checking the NullValue and the MaxLength Properties for each column and validating the returned data does not violate their values.

For example:
If a field will sometimes return nothing then the NullValue property must be set to either Empty or Nothing instead of Throw Exception.
If you have MaxLength set at 2 and there is a row with a value great than 2 digits long, you will get this error - because the length of the new row exceeds the MaxLength property. Change the MaxLength to fit the largest number (or default to -1).

Hope this helps someone.
0
Adam
Top achievements
Rank 1
answered on 26 Sep 2012, 12:26 PM
this happened to me, too, but it was because I had a primary key defined in the data table that I'd forgotten about.
Tags
General Discussions
Asked by
Tejas
Top achievements
Rank 1
Answers by
Tejas
Top achievements
Rank 1
Steve
Telerik team
nilesh
Top achievements
Rank 1
Shannon
Top achievements
Rank 1
Adam
Top achievements
Rank 1
Share this question
or