vb.net - How to use Lambda functions with embedded code in SSRS 2008 R2 reports? -


using ssrs 2008 r2 embedded code, vb.net code compiler seems err whenever need beyond simplest of statements.

for instance, want use linq select function perform operations on elements of collection, bids keeps throwing compiler errors on lines of valid vb.net code.

public function splittoids(byval multivalue string) integer()     dim regex new system.text.regularexpressions.regex("((?>.*?);#\d*;#)", system.text.regularexpressions.regexoptions.compiled or system.text.regularexpressions.regexoptions.explicitcapture or system.text.regularexpressions.regexoptions.cultureinvariant or system.text.regularexpressions.regexoptions.ignorecase)     dim results new system.collections.generic.list(of string)()     dim matches system.text.regularexpressions.matchcollection = regex.matches(multivalue)     each mvmatch system.text.regularexpressions.match in matches         results.add(mvmatch.value)     next     'dim pairs string() = splittopairs(multivalue)     'dim names system.collections.generic.ienumerable(of integer) = system.linq.enumerable.select(pairs, function(p) integer.parse(microsoft.visualbasic.split(p, ";#")(1)))     dim names system.collections.generic.ienumerable(of integer) = system.linq.enumerable.select(results, function(p) integer.parse(microsoft.visualbasic.split(p, ";#")(1)))     return system.linq.enumerable.toarray(names) end function 

on line 42, comment above call system.linq.enumerable.select, visual studio 2008 (the vs shell installed sql server 2008 r2), gives error when attempt preview report:

an error occurred during local report processing. definition of report '/xxxx' invalid. there error on line 42 of custom code: [bc30201] expression expected. 

i have learned [bc30201] generic error little relation missing expression. seen in code, have namespace qualified every function or variable beyond basic system namespace classes. in report properties dialog, references tab, i've referenced both mscorlib , system.core make sure functions i'm using in code can resolved system assembly.

so few questions...

  1. can anonymous functions called , used in ssrs 2008 r2 reports' embedded code?
  2. in getting point, getting same [bc30201] error when attempted call 1 method in embedded code another. yet, sure had simpler methods in earlier iteration of report (or report) worked... should able call 1 custom method within embedded code?

notes:

i'm highly tempted create separate code module, don't want fight political battle necessary convince lots of people should install custom assemblies on our reporting servers. unless, can call assemblies directly various report expressions, may still need use embedded code make assemblies' methods available report.

the source data comes sharepoint 2010 list. many of columns lookup columns allow multiple values. method above strips out delimiters , values return collection of ids.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -