Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i try to show xtrareport , this report was binding to SP using Framework, but this error appear during creating document .

report.CreateDocument(true);



DataRetrievalException: خطأ عند محاولة ملء مصدر البيانات. تم طرح الاستثناء التالي:
Ambiguous match found.

this line "خطأ عند محاولة ملء مصدر البيانات. تم طرح الاستثناء التالي" mean :
error when you try to populate the data source. The following exception has been thrown


This error appears as soon as you add the stored Procedure

CREATE DEFINER=`root`@`localhost` PROCEDURE `getAccountsItems_WithDate_byDates`(in startDate Datetime, in endDate Datetime)
BEGIN
		SELECT 
        accdet_Cat,
        accdet_AccountCode,
        accitem_AccID,
		MergName,
		accm_ID,
        accitem_ID,
        accitem_Date,
			FORMAT(SUM(Debit),2) Debit ,
			FORMAT(SUM(Credit),2) Credit ,
			FORMAT((SUM(Debit)-SUM(Credit)),2) Balance
        FROM view_items_accounts_tree_with_date 
        where accitem_Date between startDate And  endDate
        Group By accitem_AccID;
END



public virtual ObjectResult<getAccountsItems_WithDate_byDates_Result> getAccountsItems_WithDate_byDates(Nullable<System.DateTime> startDate, Nullable<System.DateTime> endDate)
{
    var startDateParameter = startDate.HasValue ?
        new ObjectParameter("startDate", startDate) :
        new ObjectParameter("startDate", typeof(System.DateTime));

    var endDateParameter = endDate.HasValue ?
        new ObjectParameter("endDate", endDate) :
        new ObjectParameter("endDate", typeof(System.DateTime));

    return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<getAccountsItems_WithDate_byDates_Result>("getAccountsItems_WithDate_byDates", startDateParameter, endDateParameter);
}

public virtual ObjectResult<view_items_accounts_tree_with_date> fncgetAccountsItems_WithDate_byDates(Nullable<System.DateTime> startDate, Nullable<System.DateTime> endDate)
{
    var startDateParameter = startDate.HasValue ?
        new ObjectParameter("startDate", startDate) :
        new ObjectParameter("startDate", typeof(System.DateTime));

    var endDateParameter = endDate.HasValue ?
        new ObjectParameter("endDate", endDate) :
        new ObjectParameter("endDate", typeof(System.DateTime));

    return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<view_items_accounts_tree_with_date>("fncgetAccountsItems_WithDate_byDates", startDateParameter, endDateParameter);
}

public virtual ObjectResult<view_items_accounts_tree_with_date> fncgetAccountsItems_WithDate_byDates(Nullable<System.DateTime> startDate, Nullable<System.DateTime> endDate, MergeOption mergeOption)
{
    var startDateParameter = startDate.HasValue ?
        new ObjectParameter("startDate", startDate) :
        new ObjectParameter("startDate", typeof(System.DateTime));

    var endDateParameter = endDate.HasValue ?
        new ObjectParameter("endDate", endDate) :
        new ObjectParameter("endDate", typeof(System.DateTime));

    return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<view_items_accounts_tree_with_date>("fncgetAccountsItems_WithDate_byDates", mergeOption, startDateParameter, endDateParameter);
}


What I have tried:

i tried to bind the report with the SP directly not the function but there is no fields.

also i tried to re add the stored procedure , in "manage Stored Procedures" window i clicked on Preview and the same error appear

Data loading failed because the Exception occurred
Ambiguous match found.
Posted
Updated 15-Apr-19 12:00pm
v3
Comments
j snooze 15-Apr-19 17:28pm    
Do you have multiple controls on the report with the same name or something? It doesn't know which control to bind a field to if there are controls with the same name. Not sure if thats your issue, but it is one possible scenario with the information you've given.
Golden Basim 15-Apr-19 17:46pm    
This error appears as soon as you add the stored Procedure
j snooze 15-Apr-19 17:48pm    
Does the stored procedure return fields with the same name? I would search the internet looking for these issues, you'll probably find something that matches closely to your issue.
Golden Basim 15-Apr-19 17:56pm    
also i tried to re add the stored procedure , in "manage Stored Procedures" window i clicked on Preview and the same error appear

Data loading failed because the Exception occurred
Ambiguous match found.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900