Hi guys,i was using crystal reports in my vb.net project.I read in some books and in the internet that you can create a grand total for some fields like total cost calculation.And using 'sum' you can calculate the total result.well in my case i can't find 'sum' in my crystal report which is for visual studio 2010.
what is the solution.

Hi,

It is refering to a formula : a = SUM(MyField1)

can you make it clear Waddell

Hi,

It is not a type it is a formula in a crystal! e.g. I have a table that has a column "cost", it has 3 rows with cost values of 1, 1, 2 I want my crystal field, TOTCosts, to display the sum of the cost field:=SUM(Costs) my Crystal Field now displays 4 (=1+1+2)

I figured out the problem and that is i have a label field that stores a calculated result.Then with a code that result is set with a currency format.That is you can format the result if it's in a string format.
And it's stored in the db with a field of text property.If the field is in a number format it results in a data type mismatch.and crystal reports only sums fields of number data types.
What is the solution.

This is the code
bridge asset is in decimal format
bridge asset1 is in string format

bridgeasset1 = Format(bridgeasset, "ETB #,##0.00")
            Label12.Text = bridgeasset1
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.