Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > Reporting Services
| Search | Today's Posts | Mark Forums Read
Reporting Services SQL Server Reporting Services. Please specify which version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Reporting Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 1st, 2006, 03:56 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Working with fields already in my SSRS 2005 report

In my SSRS 2005 Report I have 5 calculation fields added to my table Group and they are:

=IIf(Fields!New_Old_CC.Value = 0, Fields!PDC.Value, 0) (the Label is Field1)

=IIf(Fields!New_Old_CC.Value = 1, Fields!PDC.Value, 0) (the Label is Field2)

=IIf(Fields!New_Old_CC.Value = 0, Fields!CC.Value, 0) (the Label is Field3)

=IIf(Fields!New_Old_CC.Value = 1, Fields!CC.Value, 0) (the Label is Field4)

=Fields!FeeGoal_AZ.Value \ Fields!FeeSchedule.Value (the Label is Field5)

I want to take SUM(Fields 1-4) \ Field 5. Is there a way to reference fields already in your report that you added earlier?



I tried to do this also below but it doesn't work:

=SUM(IIf(Fields!New_Old_CC.Value = 0, Fields!PDC.Value, 0) + IIf(Fields!New_Old_CC.Value = 1, Fields!PDC.Value, 0) + IIf(Fields!New_Old_CC.Value = 0, Fields!CC.Value, 0) + IIf(Fields!New_Old_CC.Value = 1, Fields!CC.Value, 0)) – (Fields!FeeGoal_AZ.Value \ Fields!FeeSchedule.Value))


  #2 (permalink)  
Old April 3rd, 2006, 05:18 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do it via the code.

Code:
PUBLIC FUNCTION getOrderValue(orderID as double) AS STRING
    IF orderID > 1000004 then
        getOrderValue = "OVER"
        EXIT FUNCTION
    ELSE IF orderID = 1000004 then
        getOrderValue = "EQUAL"
        EXIT FUNCTION
    ELSE
        getOrderValue = "UNDER"
        EXIT FUNCTION
    END IF
END FUNCTION

PUBLIC FUNCTION setBoom(boom as string) AS STRING
    IF Boom = "UNDER" THEN
        setBoom = "Not quite there"
        EXIT FUNCTION
    ELSE IF Boom = "EQUAL" THEN
        setBoom = "Damn Skippy!"
        EXIT FUNCTION
    ELSE
        setBoom = "You went to far, Dr. Jones"
        EXIT FUNCTION
    END IF
END FUNCTION

PUBLIC DIM fldLst as String

PUBLIC FUNCTION GetFld(orderID as String) as String
    fldLst = orderID & vbnewline & fldLst
    GetFld = ""
END FUNCTION

PUBLIC FUNCTION getFldLst() as String
    getFldLst = fldLst
END FUNCTION
There is some of the code I used. Add a column or textbox and in it, you can call the bit of code you want by changing the value to =code.FUNCTIONNAME(PARAMETER)

so I have a textbox at the end of the report and set the value to =CODE.GetFldLst()





Similar Threads
Thread Thread Starter Forum Replies Last Post
SSRS 2005 Integration with ASP.Net Applications jeetu.bhagchandani Reporting Services 0 June 7th, 2008 11:56 AM
How to debug a SSRS 2005 Custom Data Extension MBryga BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 1 January 10th, 2008 11:33 AM
integrate report designer of SSRS 2005 in win app nhanhung Reporting Services 0 April 18th, 2007 10:58 PM
Styling pie charts in SSRS 2005 Dangermouse BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 February 20th, 2007 07:28 AM
SSRS 2005 Matrix Totals Problem!!!!!!!!!!!!!!!!! dba123 Reporting Services 1 February 10th, 2006 10:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.