i have code in which datatable values will be given in crystal report of vs2008 iam very surprised when i run my application in debug mode by pressing f10 key value all the value loaded perfect but when i start application in normal mode only one value of datatable is loaded what should i do like ?

description qty price total
pepsi 2 4 8
tea 1 2 2

in debug mode pressing f10 it show all the values
but in normal mode it show only first value pepsi 2 4 8

It depends on a few things...

The way the table is set up in the database. It is much easier to manage your information by using views, and not tables in Crystal Reports (especially in VS)

And the group function... I had a hard time figuring this one out. It looks like (depending on the table you are referencing) that the group should be description, and the "Details" should be qty, price, and total.

Maybe you're able to post a screen shot of the Main Report with the Database Fields and Group Name Fields expanded in the Field Explorer. This would allow me to help you further, unless of course you end up figuring it out!

Good luck!

it depends on a few things...

The way the table is set up in the database. It is much easier to manage your information by using views, and not tables in crystal reports (especially in vs)

and the group function... I had a hard time figuring this one out. It looks like (depending on the table you are referencing) that the group should be description, and the "details" should be qty, price, and total.

Maybe you're able to post a screen shot of the main report with the database fields and group name fields expanded in the field explorer. This would allow me to help you further, unless of course you end up figuring it out!

Good luck!

ok thx dear i have done it i just put new button for showing report and it works fine but now there is an other problem i have datagrid in which i enter bill detail like qty price total when i press enter it enters new row and i start entering second product detal and so on how i can validate cell like qty and price so that they can accept only number in as rows increase thx

Just to make sure I understand you correctly, you want to check that the entered value is a number? You can use .IsNumeric for something like that.
Or do you mean that you want the total to change every time you enter new information? In that case, just recalculate and update that cell every time you put new information in.
With more detail, I might be able to help a little more, but hopefully what I have put here will help.

Just to make sure I understand you correctly, you want to check that the entered value is a number? You can use .IsNumeric for something like that.
Or do you mean that you want the total to change every time you enter new information? In that case, just recalculate and update that cell every time you put new information in.
With more detail, I might be able to help a little more, but hopefully what I have put here will help.

YES DEAR I JUST WANT TO ENTER ONLY NUMBER IN QTY AND PRICE COLUMNS OF EACH ROW AS NUMBER OF ROWS INCREASE THX MY CODE GIVEN WORKS FINE BUT THERE IS NEED OF ONLY VALIDATION FOR PRICE AND QTY COLUMNS

Private Sub DgvBill_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DgvBill.KeyUp
        Try
            Dim qty As Integer = 0
            Dim price As Integer = 0
            Dim total As Integer = 0
            Dim j As Integer = 0

            If e.KeyCode = Keys.Enter Then

                DgvBill.AllowUserToAddRows = True

                For j = 0 To DgvBill.RowCount - 2
                    If DgvBill.Item("ClmQty", j).Value = "" Then
                        MsgBox("PLEASE ENTER QTY VALUE")
                        DgvBill.CurrentCell = DgvBill.Item("ClmQty", j)
                        DgvBill.BeginEdit(True)
                        DgvBill.AllowUserToAddRows = False
                        Return
                    End If

                    If DgvBill.Item("ClmPrice", j).Value = "" Then
                        MsgBox("PLEASE ENTER PRICE VALUE")
                        DgvBill.CurrentCell = DgvBill.Item("ClmPrice", j)
                        DgvBill.BeginEdit(True)
                        DgvBill.AllowUserToAddRows = False
                        Return
                    End If

                    qty = CInt(DgvBill.Item("ClmQty", j).Value.ToString)
                    price = CInt(DgvBill.Item("ClmPrice", j).Value.ToString)
                    total = qty * price
                    DgvBill.Item("ClmTotal", j).Value = total

                    ' THIS WILL RETURN TOTAL SUM VALUES

                    Dim op As New Operations
                    txtTotal.Text = CInt(op.GetTotalSum(DgvBill))
                    txtRemaning.Text = CInt(op.GetTotalSum(DgvBill))
                Next

            End If

        Catch ex As Exception
            MsgBox(ex.Message)
            Logger.logException("FrmMain ", "DgvBill_KeyUp ", ex.Message)
        End Try

jamshed - I am sorry, I do not know how to check this. Have you found a solution? Maybe someone else in this forum would have an idea?

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.