We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

advices for a report

Thread ID:

Created:

Updated:

Platform:

Replies:

118120 Feb 2,2015 10:55 PM Feb 4,2015 11:56 AM WinRT 8
loading
Tags: SfDataGrid
issam
Asked On February 2, 2015 10:55 PM

Hi,
to simplfy i have this database model
[URL=http://www.hostingpics.net/viewer.php?id=789235model.jpg][IMG]http://img15.hostingpics.net/thumbs/mini_789235model.jpg[/IMG][/URL]

as you can see , nothing exotic . just a standard Product/Order/Orderdetails relationship

each product can be sold with different prices over time (OD_PRICE column)

now what i want to show is something like this :
[URL=http://www.hostingpics.net/viewer.php?id=993297report.jpg][IMG]http://img15.hostingpics.net/thumbs/mini_993297report.jpg[/IMG][/URL]

so for each product i want to display differents prices that it was sold with , and the sum of the quantities and total


wich component i can use ?.
is pivotgrid could be used for this scenario, or a regular grid would suffice

please give me some ideas and directions , since ia have never used a pivot before


my plateform options are Winform or WPF
thanks and good day


Muthukumar Kalyanasundaram [Syncfusion]
Replied On February 2, 2015 10:55 PM

Hi Issam,

 

Thank you for your interest in Syncfusion products.

 

We have analyzed your reported scenario at our end. You can use GridGroupingControl to achieved this scenario. You can bind the datasource interior to GridGroupingControl and you can set the  prices of each products  with different prices and calculate the quantities and total amounts. Please refer the below link,

 

Link: http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/creatinggridgrouping.htm

 

Pivot Grid – We have maintained the separate link of  controls. You can select the PivotGrid control from the list of control in the link.  Please make use of below documentation link,

Link: http://help.syncfusion.com/windows%20forms

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K


issam
Replied On February 2, 2015 10:55 PM

Sound great !

Thanks for your help .

issam
Replied On February 2, 2015 10:55 PM

Hi,
after analysing the pivotgrid demos
i think that it should work for me too .
but i have noticed something strange
<a rel='nofollow' href="http://www.hostingpics.net/viewer.php?id=50396059h2.jpg"><img src="http://img4.hostingpics.net/thumbs/mini_50396059h2.jpg" alt="Heberger image" /></a>
it's from the rowpivotonly demo

if i understand correctly the amount column is calculated by (unitPrice * Qte)

but if you take the first row for example , it give different result !


issam
Replied On February 2, 2015 10:55 PM

Finally i ended up by using a datagrid with a masterdetail option ,

and it fill muy needs better after little thinking ;)


just one last thing :

here the class that is binded to the master datagrid

 public class ProductInfo
    {

        public int? ID_Product { get; set; }

        public string ProductName { get; set; }

        public double? ProductPrice { get; set; }

        public int? TotalQty { get; set; }

        public double? Amount{ get; set; }

        public List<OrderDetails> PriceDetails {get; set;}
    }

what i want is to show the detail datagrid only if the pricedetails.count subcollection > 1 .

so i want to make a condition to show the detailsgrid

thanks again .

Muthukumar Kalyanasundaram [Syncfusion]
Replied On February 2, 2015 10:55 PM

Hi Issam,

 

Thanks for your update.

 

On you mentioned dashboard sample, we have passed some random value to calculate the amount ((price * qty )-discount). Here we have modified the sample as per your need. Please refer the below code:

 

Code:

ProductSales sales = new ProductSales();

sales.Country = countries[r.Next(1, countries.GetLength(0))];

/// 1 percent discount for 1 quantity

sales.Quantity = 2;

sales.Amount = 30000 * sales.Quantity;

sales.Date = dates[r.Next(r.Next(dates.GetLength(0) + 1))];

sales.Product = products[r.Next(r.Next(products.GetLength(0) + 1))];

sales.TotalPrice = sales.Amount * sales.Quantity;

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K



Attachment: RowPivotsOnly_Demo_5877de1a.zip

issam
Replied On February 2, 2015 10:55 PM

this is great !

but for the moment , can you tell me please if i can make a condition for showing a detail grid in a master/detail sfdatagrid


i want to show the detailgrid and the + button , only if the subcollection count is greater than 1


i really appreciate your help on this

issam
Replied On February 2, 2015 10:55 PM

btw : i have switched to WPF :)

Sivakumar R [Syncfusion]
Replied On February 4, 2015 11:56 AM

Hi Issam,

By default Expander Icon won't get displayed in SfDataGrid, if subcollection count is zero. You can enable or disable this behavior by setting SfDataGird.HideEmptyGridViewDefinition property.

Documentation link:
http://help.syncfusion.com/ug/wpf/documents/masterdetailsview.htm

Thanks,
Sivakumar

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;