i am printing a datagridview into excel sheet.....
now the columns all work out, one column is like Profit column and the other is a Profit % column
Now i cant add a row to the datagridview programmaticall y because it is databound, i need to sum the profit column in the same sql statement as when im working out everything....
here is how ive done the datagridview... .
[CODE=sql]select Date,ProductID, Description,Buy ingPrice,Sellin gPrice,Profit_R =(sellingprice-buyingprice),Pr ofit=(sellingpr ice-buyingprice)/(sellingprice/100),Sold=(quan tity),Turnover= (quantity*selli ngprice),Profit Total=(sellingp rice-buyingprice)*(q uantity) from orders where date = '" & lbldate.Text & "'", sqlCon[/CODE]
all i need now is to sum up the TURNOVER column and add it to the same datagridview so that it can be printed along with the datagridview print.....
now the columns all work out, one column is like Profit column and the other is a Profit % column
Now i cant add a row to the datagridview programmaticall y because it is databound, i need to sum the profit column in the same sql statement as when im working out everything....
here is how ive done the datagridview... .
[CODE=sql]select Date,ProductID, Description,Buy ingPrice,Sellin gPrice,Profit_R =(sellingprice-buyingprice),Pr ofit=(sellingpr ice-buyingprice)/(sellingprice/100),Sold=(quan tity),Turnover= (quantity*selli ngprice),Profit Total=(sellingp rice-buyingprice)*(q uantity) from orders where date = '" & lbldate.Text & "'", sqlCon[/CODE]
all i need now is to sum up the TURNOVER column and add it to the same datagridview so that it can be printed along with the datagridview print.....
Comment