473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reports

OuTCasT
374 256MB
I am trying to write a stock report using data from 2 tables, products table and invoice table.

how it works is, everytime something is purchased that info is saved in the invoice table.
now i need to work out the total amount of each item bought in a day and the percentage of profit accumulated.

i was trying to use Crystal Reports but all the formulaes are taking abit long to learn.
i jst wld like to use sql queries to retrieve the values i need, multiply/subtract them and find the percentage of profit for each item per report.

IS THIS POSSIBLE ????
Jan 23 '08 #1
12 1563
ck9663
2,878 Expert 2GB
I am trying to write a stock report using data from 2 tables, products table and invoice table.

how it works is, everytime something is purchased that info is saved in the invoice table.
now i need to work out the total amount of each item bought in a day and the percentage of profit accumulated.

i was trying to use Crystal Reports but all the formulaes are taking abit long to learn.
i jst wld like to use sql queries to retrieve the values i need, multiply/subtract them and find the percentage of profit for each item per report.

IS THIS POSSIBLE ????
would you mind posting any query that you have so far? we might also need to see the structure of your table, their relationship and the formula to get all these

-- ck
Jan 23 '08 #2
OuTCasT
374 256MB
would you mind posting any query that you have so far? we might also need to see the structure of your table, their relationship and the formula to get all these

-- ck
ok i have a table.....that has all the details necessary.
ProductID, Buying Price, Selling PRice, DateOf purchase , qty soldetc

now i need to find the percentage sold for each product. and the profit from each product which i think is easy enough, take the selling price and subtract the buying price from it and just multiply it by the qty sold.

and so for the percentage aswell.

Now do i use a SUM statement to work all that out ????
Jan 25 '08 #3
ck9663
2,878 Expert 2GB
you can create a function or a view that will store the query...your query could look something like:

select ProductID, BuyingPrice, SellingPRice, DateOf purchase , qty,
totalsale = BuyingPrice * qty, Income = (SellingPrice-BuyingPrice) * qty
from mytable
where....

you can also create summaries by grouping ProductID...

-- ck
Jan 25 '08 #4
OuTCasT
374 256MB
you can create a function or a view that will store the query...your query could look something like:

select ProductID, BuyingPrice, SellingPRice, DateOf purchase , qty,
totalsale = BuyingPrice * qty, Income = (SellingPrice-BuyingPrice) * qty
from mytable
where....

you can also create summaries by grouping ProductID...

-- ck
well well, that did help a little.
Crystal Reports doesnt make it very easy unless you have done a full tutorial on it or had alot of experience with the program.

So i took the code u put in here to retrieve all the data that i want by the date selected in the datetimepicker.....ok so how do i get that information into a form, what control would i use......like a listbox or wat ???
Jan 25 '08 #5
ck9663
2,878 Expert 2GB
well well, that did help a little.
Crystal Reports doesnt make it very easy unless you have done a full tutorial on it or had alot of experience with the program.

So i took the code u put in here to retrieve all the data that i want by the date selected in the datetimepicker.....ok so how do i get that information into a form, what control would i use......like a listbox or wat ???
that would depend on what kind of GUI you are using...

-- ck
Jan 25 '08 #6
Delerna
1,134 Expert 1GB
What kind of GUI

Intranet Web Page???
MSAccess Form???
Other????
Jan 25 '08 #7
OuTCasT
374 256MB
What kind of GUI

Intranet Web Page???
MSAccess Form???
Other????
its a normal windows form application.
i used a listbox for my shopping cart when they buy things
like this

Expand|Select|Wrap|Line Numbers
  1. Dim UnitPrice As Single
  2.         If TextBox1.Text = "" Then
  3.             MessageBox.Show("You must select a product.", "Purchase Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
  4.             Exit Sub
  5.         End If
  6.         'Find unit price of selected product
  7.         Dim NRec As Integer
  8.         For NRec = 0 To productsTable.Rows.Count - 1
  9.             If productsTable.Rows(NRec).Item("Description").ToString = TextBox1.Text.ToString Then
  10.                 UnitPrice = CSng(productsTable.Rows(NRec).Item("SellingPrice"))
  11.                 Exit For
  12.             End If
  13.         Next
  14.         Dim sqlcom1 As New SqlCommand("select description from products where productid = '" & TextBox1.Text & "'", sqlCon)
  15.         Dim sqlcom2 As New SqlCommand("select sellingprice from products where productid = '" & TextBox1.Text & "'", sqlCon)
  16.  
  17.  
  18.         lstCart.Items.Add(Format(nudQuantity.Value, "##") + " " + TextBox1.Text.ToString + "-" + sqlcom1.ExecuteScalar + " " + Format(sqlcom2.ExecuteScalar, "R0.00"))
  19.         'Adjust total price
  20.         lblTotal.Text = Format(Val(lblTotal.Text) + nudQuantity.Value * sqlcom2.ExecuteScalar, "0.00")
  21.         Label2.Text = sqlcom1.ExecuteScalar
  22.         TextBox1.Text = ""
  23.  
that just brought all the values that i needed into the listbox from the use input....not underneath each other but in a row.....
now i need to pull the report using the same means i think, is there another way instead of using a listbox ????

this is the code i was using
Expand|Select|Wrap|Line Numbers
  1. select Date,ProductID,Description,StockSold=quantity ,TotalSale = sellingprice * quantity, Income = (SellingPrice-buyingprice) * quantity
  2. from orders
  3. where date = '2008/01/25'
now i need all of these to be in a row in the listbox

DATE PRODUCTID DESCRIPTION STOCKSOLD TOTALSALE INCOME
Jan 26 '08 #8
OuTCasT
374 256MB
I got the reports to work using a gridview control.
used a table adapter and data table to retrieve the info from database and insert it into the gridview.


Thanks
Jan 28 '08 #9
I am trying to write a stock report using data from 2 tables, products table and invoice table.

how it works is, everytime something is purchased that info is saved in the invoice table.
now i need to work out the total amount of each item bought in a day and the percentage of profit accumulated.

i was trying to use Crystal Reports but all the formulaes are taking abit long to learn.
i jst wld like to use sql queries to retrieve the values i need, multiply/subtract them and find the percentage of profit for each item per report.

IS THIS POSSIBLE ????
Try also to use this reporting tool:http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=21

That is enough pretty that you can try to do it using free version of the tool.
Jan 28 '08 #10
OuTCasT
374 256MB
Try also to use this reporting tool:http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=21

That is enough pretty that you can try to do it using free version of the tool.
i will try that thankyou.
Jan 28 '08 #11
i will try that thankyou.

Did you manage to try this tool? Was it useful?

I am very interested in your experience / opinion on it.
Feb 1 '08 #12
OuTCasT
374 256MB
Did you manage to try this tool? Was it useful?

I am very interested in your experience / opinion on it.
I did check it out and its pretty impressive.
But i wrote a datagridview extension which lets me print from a datagridview, so i just pulled the items i needed into the datagridview and did all the calculations using sql queries and it works 100%,

Only problem is i cant get the SUMMED totals from the column i use to add a row into the datagrid so that the total values that i want to display are printed with the datagridview.
Feb 1 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
2
by: Andrew | last post by:
Hi there: I can successfully control a report's GroupLevel ControlSource property by using: ..Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName" where rptEESTMT_A is the actual...
0
by: Ian | last post by:
(Sorry if I have repeated this, it did not appear the first time) I have the following code on a button. The idea is that when this button is clicked it prints several reports automatically then...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
1
by: KEVIN97810 | last post by:
Hello to all, I am trying to fill all my reports in a listbox but I may not need to show other reports. How do you modify this function to do that. I have losts of reports but don't want to...
2
by: B.Newman | last post by:
I've got some VB.NET code that *should* get a list of reports from an Access MDB and populate a list box with them. It doesn't detect any of the reports at all. oAccess.Reports.Count comes up as...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
12
by: Tony Ciconte | last post by:
We are evaluating the prospect of integrating and/or using Crystal Reports with some of our current products. Some of these are still in Access 97 and are running well. Since we cannot include the...
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
3
by: joelpollock | last post by:
I'm having trouble continuously page numbering a large report in MS Access. The report is made up of three separate Access reports which I join together at the end. In the past I have opened the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.