Sunday, March 11, 2012

Dynamically execute a string as an expression

Hi,

Is it possible to execute a string which is entered in the value of a texbox.

For example:
I have a table with 4 groups. The detail row of the table is filled with a dynamic query like:
="SELECT FactSales.CustomerNr, " & Parameters!SalesFigure.Value & " AS SelectedFigure FROM DWHSales". The "SelectedFigure" comes from a Parameter Combobox. Because the SelectedFigure could not allways be sumed (sometimes I have to do some special math's), i will put in the group header rows a string like

=Code.GenerateSumString(......)

which returns a string like "Sum(Fields!Fieldx.Value)" and this string should be executed, Is there a mechanism like =Execute(Code.GenerateSumString(...)) available or how can I do such things?

Thanks
Hans

SSRS reports can call external .NET code. In your case, the external code can execute the SQL string against the database.

No comments:

Post a Comment