I recently moved a couple of reports to an Sharepoint portal in Integrated mode.
One of the reports contains some custom code and failed to deploy to the Sharepoint portal.

The same code that works in your development environment, might not necessarily work when deploying to the server.

Here are some of the reasons I found that caused me headaches:

Problem:  

References to objects like Report or Fields will not compile.

Solution:  

Don’t use objects like Report of Fields in your custom code area. Instead, send the values they might keep through as a variable in your function’s declaration part.

Problem:  

Beware of line breaks. The rerport fails to deploy with an “Expression required” error.

Solution:

Remove any carriage return/line feed where not really needed.

Code before:

Public FUNCTION GetSelectedOrgParam() As String 
    Dim sReturn As String  
    sReturn =  
    SWITCH
    (   
         Report.Parameters!pChannel.Value <> 1,"[Channel]"        
         Report.Parameters!pRegion.Value <> 1,"[Region]"            
    )  
    Return sReturn
End Function

Code after:

Public FUNCTION GetSelectedOrgParam(Channel As String, Region As String) As String 
    Dim sReturn As String  
    sReturn = SWITCH(Channel <> 1,"[Channel]",Region <> 1,"[Region]")  
    Return sReturn
End Function