Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > Reporting Services
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 1st, 2006, 02: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))


Reply With Quote
  #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()



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10: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 06:28 AM
SSRS 2005 Matrix Totals Problem!!!!!!!!!!!!!!!!! dba123 Reporting Services 1 February 10th, 2006 09:00 AM



All times are GMT -4. The time now is 05:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.