hi every one i am trying to get a total in vb.net. i have a booking form which has fields like cust_id,date,location and payment. what i want to do is to generate a report so that when administrator wants to see report of total sale of suppose for the month of januray 2012. the report shows the total number of customer served and total sale amount as a report. And same thing i want to do with yearly or quarterly reprts.please can you give ideas or code.

What are you using to hold your data? It's almost always the case that dbs offer results like this a lot faster than windows (or web or console) programs will with sequential processing.

By report, are we talking about Crystal reports or you need a form with 2 textboxes for your sums? I got the impression that you are describing the form.

i am using sql server as database and vb.net as front end the data is displayed in a grid view and yea i want to see the result in crystal report but i dont know how to use them at all

I think it will be a lot easier for you to create a view with the data you want to report (except the sums and the formating of course) and use that as a source.

For the sums you'll need running totals which should cause you any problems, but leave it for last.

as adam_k said , it is better to use view or query to get sum of total payment. this is fast way to generate the reports, well you can also use group by and get sum of payment in your reporting tools , for example crystal reports , telerik reports etc. if you tell me about your reporting tools then it will be easy for me to guide you step by step to perform this action.

Regards

i will be using crystal reports and my payment is in datagridview

crystal report , then just add group on your month , and then use summary to get total of your payment field , you can use summary option by using wizard and also you can get sum of all records of field payment by doing this , just right click at the detail of field and choose add summary and then a window will open , select the sum from the combo and other option according to your requirement and then press ok you will get the sum .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.