Showing posts with label body. Show all posts
Showing posts with label body. Show all posts

Friday, March 9, 2012

How to sub total a calculated column?

In my report body, there is table, which contains a column displaying calculated data based on a field from a dataset. The expression for the cell called "calculatedCost" below this column is :

"=Iif(Fields!Facotr.Value=0, Fields!cost.Value * Fields!Quantity.Value *1,Fields!cost.Value * Fields!Quantity.Value *Fields!Factor.Value)

The data row in the table will be grouped by fields called Code like "A", "B" and etc. Now I need to sub total the above calculated column under each group, i.e. Subtotals for Code A and Code B. How can I do this? I tried the following expression:

=Sum(ReportItems("calculatedCost").Value)

But I got an error saying that Aggregate functions couldn't be used in report body. Then how can I refer the value of cell "calculatedCost"? Any suggestion will be highly appreciated..

You could perform the calculation in your dataset and not display that field.

SELECT *, (<Expression HERE>) As CalcField FROM Query

Then use that field in the summary field.

=SUM(Fields!CalcField.Value)

|||Thanks a lot. I got it work!

Friday, February 24, 2012

how to store and read .doc file in a table

I would like to store and read .doc file in a table of sql server using C#.

Can some body help me on this? my id ispadam76@.gmail.com.

Thanks & Regard,
Padam Kumar Tripathi

you could use binary, image or varbinary datatypes. it will drag the database, queries could be slow.

On the other hand, you could save the file on a shared drive and save the path of the file location in a table. if you need code, please google.