Friday, February 24, 2012

Cell reference in SQL Report

Hi,

Is it possible to use Cell reference in the calculations, in SQL reports.

Like Excel allows "=A1 * B1", where A1 and B1 are two cells with some numeric value. Is it possible to use Cell reference in SQL reports? Like "textbox1 * textbox 2"... or something like that, with textbox1 and textbox2 containing some numeric values.

Thanks

Perm

Yes. You can name a text box and then reference it using ReportItems!. If you have 2 text boxes named txtA and txtB and you want to add the two and put in a third box you can put ReportItems!txtA.value+ReportItems!txtB.value in the third textbox to get the total of the two cells.|||

Hi Kim,

Thank you very much for the quick reply!! It works.

Now, the next item I'm stuck on, is the running total of this calculated field. Here is the detail of my RDL:

In a table, I have "textbox34" with the formula =count(Fields!ADF_NO.Value) in it and "textbox30" with the formula =first(Fields!TOTSTKS2.Value, "ProdServSales") - reportitems!TOTSTKS.value in it. I have divided "textbox 34" with "textbox30", and placed the results in "textbox36". Now, I want to do a cummulative total (Running total) of "textbox36", using the formula =runningvalue(reportitems!textbox36.Value, sum, nothing) in "textbox14". Its giving me an error saying:

"[rsAggregateReportItemInBody] The Value expression for the textbox 'textbox14' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers."

Any suggestions? I appreciate you help on this.

Thanks

Perm

No comments:

Post a Comment