Posted: 4/9/2012
i m using this
expression
=Code.ReportHeading1(ReportItems!textReportHeading1.value)
but when i run report it gives me error like #error
ssrsnew, when you send a question in like this, without seeing the code that you are referencing, I don't think anyone on the planet can help?
Posted: 4/10/2012
And probably the data that ReportItems!textReportHeading1.value represents as well.
alright,
this is my custome code in report
for that expression.
Private curTranId As Integer = Int32.MinValuePrivate curPortId As Integer = Int32.MinValuePrivate ret As String = NothingPrivate cHeading1 as ObjectProtected Overrides Sub OnInit() cHeading1 = nothing End SubPublic Function LumpComments(TranId as Integer, PortId as Integer, Comment as String) as String If curTranId = TranId and curPortId = PortId Then If Not String.IsNullOrEmpty(Comment) Then ret = ret & CHR(10) & Comment Else curTranId = TranId curPortId = PortId ret = Comment 'If Not String.IsNullOrEmpty(Comment) Then ret = Comment Else ret = Nothing End If Return retEnd Function Public Function GetReportHeading1(ReportHeading1 as Object) as Stringif ReportHeading1 is nothing return cHeading1 else cHeading1 = ReportHeading1 return cHeading1end ifEnd FunctionDim StyleSheetHash As System.Collections.HashtablePublic Function InitStyleSheet() Dim xmlDocument As System.Xml.XmlDocument = New System.Xml.XmlDocument() xmlDocument.LoadXml(Report.Parameters!StyleSheetXML.Value) Dim rootNode As System.Xml.XmlElement = xmlDocument.SelectSingleNode("StyleSheetInfo") StyleSheetHash = New System.Collections.Hashtable() For Each a As System.Xml.XmlAttribute In rootNode.Attributes StyleSheetHash.Add(a.Name, a.Value) Next End FunctionPublic Function StyleSheetValue(StyleSheetValueName As String) As String If (styleSheetHash Is Nothing) InitStyleSheet() End If If (StyleSheetHash.ContainsKey(StyleSheetValueName)) Return StyleSheetHash(StyleSheetValueName) End If Return NothingEnd Function
now let me know why it is not working
Posted: 4/12/2012
ssrsnew, you make this call: =Code.ReportHeading1(ReportItems!textReportHeading1.value)
but in your code you have: Public Function GetReportHeading1
Have you tried: =Code.GetReportHeading1(ReportItems!textReportHeading1.value)