Click here to monitor SSC

SQL Server 2008 Reporting Services

Last post 03-09-2009, 11:12 AM by Mentor. 1 replies.
Sort Posts: Previous Next
  •  03-05-2009, 9:25 AM Post number 72340

    SQL Server 2008 Reporting Services

    I have a Report Project which has 2 data sets. With dataset1 i get some values, make some calculations and then i'm trying to pas those calculated values as parameters in the second data set. Lets make a simple example:
    Dataset1 takes no parameter and returns say ID, Rate, NPER, and PV
    Dataset2 takes two parameters, the @ID and the @PMT value.
    I make a calculation which returns the PMT Excel function with the following expression:
    =-Pmt(First(Fields!Rate.Value, "Dataset1") / 100, First(Fields!NPER.Value, "Dataset1"), First(Fields!PV.Value, "Dataset1"))

    I'm trying to use this expression into Dataset2 parameter @PMT
    So far i cant make it work, it shows this error:  Fields cannot be used in report parameter expressions.
    I have tried to make parameters of Dataset2 as Internal or Hidden and specify a default value with the expression above but still dont work.

    Thx in advance,
    Best regards,
    Mentor Ibrahimi
  •  03-09-2009, 11:12 AM Post number 72389 in reply to post number 72340

    Re: SQL Server 2008 Reporting Services

    Hello everybody,

    Since no one proposed anything i had to start doing it the hard way. What i did is first i created an assembly in C# and deployed it into server, created two functions that used two methods from assembly. I started running the query and it showed some errors saying that it could not calculate the RATE with the supplied values, so i started testing the assembly and found the same problem with those values. I run directly into excel and found that it was working. So, what i did then, is changed the assembly from C# to VB.NET, redeployed assembly and recreated the functions and now i'm getting the whole dataset calculated from database. Cheers!
View as RSS news feed in XML