Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Subreport By Parameter with Character Leading Zero - Subreport Empty

Status
Not open for further replies.

S3066

Technical User
Aug 1, 2001
66
US
Hello,

I'm linking a subreport to a main report, using a character field (employee number) in the main container report to link to an employee number prompt in the subreport. The problem is, for employee numbers with a leading zero, the subreport at runtime generates an empty result set. All other employee numbers generate subreport data fine.

The only cause I can think of is somehow the employee numbers with leading zeros are being translated as a number when being linked to the subreport. Except I checked the subreport employee parameter, and that is defined as a string!
When I run the subreport standalone for that leading zero employee number, data does appear. So the subreport on its own is pulling the data in fine. It's just when linked to the container main report that the empty result set occurs.

Very frustrating; any ideas appreciated.

Oh, and I'm on Crystal 2008. The version under "About" says 12.0.0.683.

Thanks all.

-SL
 
You will need a formula to add a leading zero(s) to the string in the main report. Then use that formula to link to the subreport. If you are sure that there is only one zero and always a zero, your formula could look something like this '0'+{employeeNum}.
 
The field is already a string with leading zeros. Thanks
 
Then I am confused. It appears that you are passing valid data to the sub-report. I can only suggest really examining the data in the main report and the sub-report to make sure they are exactly alike.
 
Question: How did you look for leading zero employee number?

1. I would add the following the SELECT EXPERT against the employee number

LIKE(length({employee number})[1]) "0" or " " or NULL
use to fine all employee number with "0" or " " or null


I found this reference page


ToWords(number)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top