Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Custom code in SSRS

Posted on 2011-10-10
4
Medium Priority
?
1,856 Views
Last Modified: 2012-05-12
I am setting up code in the custom code area of report properties in SSRS 2008. I am having problems setting up the public function for two fields. I have to have one for pbm_propertyClass and one for pbm_TotalAssessment. I need the pbm_propertyClass to set up and If statement to see if it less than 710 and if so add the total to nonexempt field to use in a percentage calculation. Then if it less than 710 I willl need to set up a seperate function I believe. My problem is I don't know how to declare both virables in one public function statement.   Both of these virables are table fields in the dataset.  it gives me the following error when I try to view the report.  The definition of the report 'PropertyClass is invalid. There is an error on line 1 of custom code:[BC30205] End of statement expected.
' Non Eempt Property values
Public function PropClass(ByVal pbm_PropertyClass as Integer), nonexempt (byval pmb_totalAssessment as integer)



  ' Non Exempt property classes are less than 710
If pbm_PropertyClass < 710 
NonExempt = NonExempt + pbm_TotalAssessment
End if
End Function

Open in new window

0
Comment
Question by:stevenofva
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
planocz earned 2000 total points
ID: 36955817
you need something like this....

Public Function PropClass (ByVal pbm_PropertyClass as Integer, Byval pmb_totalAssessment as integer) as Object
If pbm_PropertyClass < 710
NonExempt += pbm_TotalAssessment
Else
       Return 0
End if
    Return NonExempt
End Function

'IN Report ......
'=Code.PropClass(Fields!pbm_PropertyClass.Value, Fields!pmb_totalAssessment.Value)
0
 

Author Comment

by:stevenofva
ID: 36961829
Sorry for not thinking everybody yesterday I got busy with another project. Thank you for helping me with the code.
Steve
0
 
LVL 27

Expert Comment

by:planocz
ID: 36961904
Glad to help :)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question