BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Ashok,
Thank you for your interest in Syncfusion products.
We have prepared a pivot grid sample with a Data Table.With this you use SQL stored procedure as per your requirement. Kindly
refer the below provided sample implementing your requirement.
Please let us know if you have any other concerns.
Thanks & Regards,
AL.Solai.
Thanks AL.Solai. Its working perfectly
Hi Ashok,
Thanks for the update.
Please let us know if you have any other further concerns.
Thanks & Regards,
AL.Solai.
Hi Pravin,
Thank you for your update.
We would like to suggest you to convert the Sql database(or any other Stored procedure) to DataTable. so that we can easily assign the data source to the pivot grid. Please refer the below code snippet we used in our sample. We also like to let you know that we have to use the System.Data.SqlServerCe.dll assembly to run this sample. We have also attached the dll in the below sample. We have used a sample database file named “NorthWind.sdf”.
C#:
this.pivotGridControl1.ItemSource = GetsData();
// Adding PivotRows to the Control
this.pivotGridControl1.PivotRows.Add(new PivotItem { FieldMappingName = "City", TotalHeader = "Total" });
this.pivotGridControl1.PivotRows.Add(new PivotItem { FieldMappingName = "Last Name", TotalHeader = "Total" });
// Adding PivotColumns to the Control
this.pivotGridControl1.PivotColumns.Add(new PivotItem { FieldMappingName = "Country", TotalHeader = "Total" });
// Adding PivotCalculations to the Control
this.pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Extension", Format = "C", SummaryType = SummaryType.DoubleTotalSum });
public DataTable GetsData()
{
SqlCeConnection con = new SqlCeConnection("Data Source = E:\\DB\\Northwind.sdf; Password = Hebot15v");
con.Open();
SqlCeDataAdapter adp = new SqlCeDataAdapter("SELECT \t[Employees].[Employee ID]\t,[Employees].[Last Name]\t,[Employees].[First Name]\t,[Employees].[Title]\t,[Employees].[Birth Date]\t,[Employees].[Hire Date]\t,[Employees].[Address]\t,[Employees].[City]\t,[Employees].[Region]\t,[Employees].[Postal Code]\t,[Employees].[Country]\t,[Employees].[Home Phone]\t,[Employees].[Extension]\t,[Employees].[Photo]\t,[Employees].[Notes]\t,[Employees].[Reports To] FROM \t[Employees]", con);
DataTable dt = new DataTable();
adp.Fill(dt);
return dt;
}
Please let me know if you have any concerns.
Regards,
Neelakandan