Wednesday, April 2, 2014

Crystal Reports: Unexpected database connector error

When the parameters in a crystal report query are not in the form <TableName>.<ColumnName>, it sometimes throw the following exception.

 detected an exception: Unexpected database connector error
at com.crystaldecisions.reports.datafoundation.DFQuery.for(SourceFile:632)
at com.crystaldecisions.reports.datalayer.a.do(SourceFile:1621)
at com.crystaldecisions.reports.datalayer.a.a(SourceFile:1404)

To fix this exception, just add the corresponding table name following by the period to front of your parameters which are table columns in your database. For example, if you have a parameter named condition and its value is a string  value="name='apple' and location='America'", when you set it using code like the following:

ParameterFieldController pfc = <your code to get the ParameterFieldController>;
pfc.setCurrentValue("", "condition", value);

You may get the above exception.

Change the value to String value="Fruit.name='apple' and Fruit.location='America'" where Fruit is the table name in your database should fix the above exception.

--------------------------------------------------------------------------------------------------------

                        
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.

No comments:

Post a Comment