cancel
Showing results for 
Search instead for 
Did you mean: 

CR for VS2010 SP2: ParameterFieldDefinition.UseCount returns 0

Former Member
0 Kudos

Dear Sirs,

In older versions of Crystal Reports (9, XI R2) we have used property ParameterFieldDefinition.UseCount to optimize report's parameter processing. In CR for VS2010 SP2 this property always returns 0. Why?

Greetings

Pavlo Ivakhiv

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Here is the [API reference guide for CR for VS 2010 .NET SDK|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip].

UseCount property was provided by / Inherited from FieldDefinition Class, which was used to get the number of times a field is used in a report.

Try the ParameterFieldDefinitions.Count Property which gets the number of ParameterFieldDefinition objects in the collection.

- Bhushan.

Former Member
0 Kudos

We are using UseCount property exactly by its semantic: we need to know if field (in this case parameter) is used in the report (UseCount > 0), and then we'll process this field, else we'll ignore it. In case CR always reports UseCount == 0 our code is broken.

Greetings

Pavlo Ivakhiv

former_member183750
Active Contributor
0 Kudos

This is rather interesting. I found the following kB:

[1218478 - UseCount property incorrectly returned as '1'|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333433373338%7D.do]

The above applies to CR 9.1 (bundled with .NET 2003), CR 10.2 (bundled with .NET 2005) and CR 10.5 (bundled with .NET 2008).

ADAPT00202049 (e.g. fix request) was rejected by R&D, however a work-around is provided in the KB. While the KB specifies the issue is UseCount returning 1 as opposed to zero, I am pretty sure that creating a new fix request will result in the same rejection as for ADAPT00202049.

- Ludek

Former Member
0 Kudos

For those, who seek alternative solution and don't want to spend time seeking the reason why UseCount == 0, I could point to new property ParameterFieldDefinition.ParameterFieldUsage2 and enum member ParameterFieldUsage2.NotInUse.

Pavlo

former_member183750
Active Contributor
0 Kudos

I'ts been pointed out to me that as of Crystal Reports 2008, ParameterFieldUsage has been deprecated and using ParameterFieldUsage2 is recommended instead. Apparently this is documented in the Developer Help, but I was not aware of it - apologies.

- Ludek

Answers (0)