vwduud
November 29th, 2004, 06:02 PM
I have a basic report that displays a column of information based on a bank identification number from a Table named RunTable. The RunTable table has two columns, both string columns. First column is named BankID, second column is named Amount.
In the report, I have created a field parameter named "jimbob". In the Formula Editor dialog, I created a Record Selection formula that looks like this:
{Banks.BankID} = {?jimbob}
The RunTable has 9 rows of data:
BankID Amount
001 2003
001 1987
001 254
002 3876
002 5487
002 6598
003 6579
003 8709
003 113
The report will display the input parameter in the a field in the header and the column of data based on the input parameter (Banks.BankID). So, if you run Print Preview and enter '001' for the Discrete Value, '001' prints at the top, and the 3 corresponding Amount values print down the report. Works as expected. For clarification the input field '?jimbob' is linked to a field on the report, just toecho its value (for testing/verification purposes).
Now, for the problem. I am attempting to call this report from a C++ application. I am able to set the input parameter in my C++ code. However, when using the syntax in the formula of the report:
{Banks.BankID} = {?jimbob}
I get an return error from the function PEStartPrintJob. The error is:
"Error in formula <Record_Selection> '{Banks.BankID} = {?jimbob}' This field name is not known"
Of course, with this error, the report does not print.
If I change the formula from the above to a hard coded version like:
{Banks.BankID} = '001'
the report does come up with no errors with the data from the bank with id "001"(obviously). The input field is of course ignored, but is still echoed on the report in its field in the header of the report.
Because I have a field on the report displaying the passed in input parameter, this hard coded method allows me to see that the input parameter is getting passed in and displayed accurately. Changing the input parameter, but leaving the formula hard coded does properly change the field value as it displays on the report.
In summary, I am getting my input value into the report, from my code; its does echo properly on the report when changed. Obviously this is not going to work (hard coded formula) in the real world application). Can anyone offer any suggestions towards a solution to get rid of the error message stated above and make this work?
Thanks - Jim
In the report, I have created a field parameter named "jimbob". In the Formula Editor dialog, I created a Record Selection formula that looks like this:
{Banks.BankID} = {?jimbob}
The RunTable has 9 rows of data:
BankID Amount
001 2003
001 1987
001 254
002 3876
002 5487
002 6598
003 6579
003 8709
003 113
The report will display the input parameter in the a field in the header and the column of data based on the input parameter (Banks.BankID). So, if you run Print Preview and enter '001' for the Discrete Value, '001' prints at the top, and the 3 corresponding Amount values print down the report. Works as expected. For clarification the input field '?jimbob' is linked to a field on the report, just toecho its value (for testing/verification purposes).
Now, for the problem. I am attempting to call this report from a C++ application. I am able to set the input parameter in my C++ code. However, when using the syntax in the formula of the report:
{Banks.BankID} = {?jimbob}
I get an return error from the function PEStartPrintJob. The error is:
"Error in formula <Record_Selection> '{Banks.BankID} = {?jimbob}' This field name is not known"
Of course, with this error, the report does not print.
If I change the formula from the above to a hard coded version like:
{Banks.BankID} = '001'
the report does come up with no errors with the data from the bank with id "001"(obviously). The input field is of course ignored, but is still echoed on the report in its field in the header of the report.
Because I have a field on the report displaying the passed in input parameter, this hard coded method allows me to see that the input parameter is getting passed in and displayed accurately. Changing the input parameter, but leaving the formula hard coded does properly change the field value as it displays on the report.
In summary, I am getting my input value into the report, from my code; its does echo properly on the report when changed. Obviously this is not going to work (hard coded formula) in the real world application). Can anyone offer any suggestions towards a solution to get rid of the error message stated above and make this work?
Thanks - Jim