adolf garlic


I have code

Function GetDealCount(reportItems)

return iif(IsNothing(reportItems!txtDetailCountRows.Value), 0, reportItems!txtDetailCountRows.Value)

End Function

Function GetSumNotionalAmount(reportItems)

return iif(IsNothing(reportItems!txtDealSumNotionalAmount.Value), 0, reportItems!txtDealSumNotionalAmount.Value)

End Function

That I am calling from a textboxes in the page header

= Code.GetDealCount(ReportItems) & " Deal(s)"

also

= Parameters!BaseCurrency.Value + " " + Format(Code.GetSumNotionalAmount(ReportItems),"N2").ToString().Replace(",","'")

When I preview the report in VS.NET I get values showing.

When I deploy the report I just get #Error showing.

Also this report used to work fine in RS2000

Does anyone know the cause of this issue





Re: code!func to get values in header only works in IDE and not deployed report (also worked ok in RS2000)

Lisa Nicholls


I'm not sure why you don't have declared return types for your functions I would do a couple of things:

1) declare the return types as Strings because you are concatenating with Strings

2) make sure all your concatenation expressions that might be implicitly casting types use & instead of + (Parameters!BaseCurrency.Value & " " & Format(Code.GetSumNotionalAmount) etc. IOW )

... I don't know if this will make any difference. If it doesn't there is probably some data problem, for example what happen when ISNOTHING(Parameters!BaseCurrency.Value )

>L<







Re: code!func to get values in header only works in IDE and not deployed report (also worked ok in RS2000)

adolf garlic

I tried your suggestions but to no avail.

I don't think it is a data problem as both the IDE and the deployed report are pointing at the same db.

(the rest of the data is identical)

I have deleted the cache of .data files locally.

I am going to try reimporting from 2000->2005 to see if anything got corrupted.

Also, when I changed + to &, it started returning N2 instead of the value (!)







Re: code!func to get values in header only works in IDE and not deployed report (also worked ok in RS2000)

adolf garlic

I tried moving the hidden (body) textboxes outside the rectangle they were in and I also hardcoded the values therein.

this still did not work

I'm confused as to why the IDE can correctly reference the textboxes, but the deployed report cannot.






Re: code!func to get values in header only works in IDE and not deployed report (also worked ok in RS2000)

adolf garlic

I changed it as follows and it works:

remove anything in "code" dialog

hidden body textbox[txtDetailCountRows] expression is now:

=iif(IsNothing(CountRows("DataSetDeal")), 0,CountRows("DataSetDeal"))

header textbox is now

= reportItems!txtDetailCountRows.Value & " Deal(s)"

I am still convinced that this is some kind of bug in RS.

- it works fine in 2000

- it works fine in the IDE preview pane






Re: code!func to get values in header only works in IDE and not deployed report (also worked ok in RS2000)

Lisa Nicholls

Well that is weird <s>. Your new way is better, but I'm still kind of curious. I haven't sat down and tried to repro, but the only think I can think that would cause this is some kind of difference in the sequence of evaluation.

>L<