Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my first report . My Fields are Buyer Name, Item Name, Quantity, Unit and I have buyer name group. Please Guide me with example

In each buyer name group footer I want that it should give me total quantity of the buyer name which is based on unit wise example mention below

Buyer Name : ABC
commodity quantity Unit
Rice 10 25
Rice 5 25
Rice 3 30
XXX 2 25
yyy 1 50
zzz 3 40

now in buyer group footer it should show me
Unit 25 Total= 17 Unit 30 Total = 3 Unit 40 Total = 3 Unit 50 Total = 1
Total Quantity = 24

2nd problem is when it try to filter data code fromdate to todate mention below it give me some big line error "the remaining text does not appear to be part of the formula detalils errorkind"

What I have tried:

for my first query I do not know how to do it gives me total quantity but not unit wise

for my second query
crys.Load(@"D:\DalaliPlus\DalaliPlus\DalaliPlus\Crystal Report\crystalreport1.rpt");
crystalReportViewer1.ReportSource = crys;
crystalReportViewer1.SelectionFormula = "BuyerDetailSeller.Ddate=>" + fromdate.Value.ToShortDateString() + "  AND BuyerDetailSeller.Ddate <= " + todate.Value.ToShortDateString() + "";
Posted
Updated 4-Aug-20 1:54am
Comments
Maciej Los 4-Aug-20 4:24am    
When user's regional settings are different than sql server settings, then fromdate.Value.ToShortDateString() will causes error.
Member 14906011 4-Aug-20 5:55am    
Sir I have not installed sql server
only Visual studio and crystal runtime

in properties i have mention
fromdate as short and value as 03/08/2020
todate as short and value as 03/08/2020


when i used this in access database query
"select * from buyerdetailseller where (((buyersellerdetail.ddate) between #01/04/2019# AND #05/09/2019#));

i got the result but not in

then why i not getting the same in
crystalReportViewer1.SelectionFormula = "BuyerDetailSeller.Ddate=>#" + fromdate.Value.ToShortDateString() + "# AND BuyerDetailSeller.Ddate <= "# + todate.Value.ToShortDateString() + "#";

1 solution

Thank You for your support But I got the solution
This function i used without changing anything

crystalReportViewer1.SelectionFormula = "{BuyerDetailSeller.Ddate} >= CDATE('" + fromdate1.Value.ToString("yyyy,MM,dd") + "') AND {BuyerDetailSeller.Ddate} <= CDATE('" + todate1.Value.ToString("yyyy,MM,dd") + "')";
 
Share this answer
 
Comments
Member 14906991 5-Aug-20 3:11am    
in main group automatic in subgroup in update function in visual code in save function it will come
Member 14906011 5-Aug-20 4:12am    
Thanks you very much I got it

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