Crystal Report Error 'a string is required here'

This is because the original BAQ/XML ReportParams table incorrectly passed date fields as character-type. E10 now does it properly – forcing you to make a couple modifications on the date param fields.

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, October 06, 2015 4:09 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Crystal Report Error 'a string is required here'

 

 

Sorry - I forgot to mention that this code was from the Report Record selection formula editor.  Maybe this error only applies to record selections?

 

DaveO


I've recently gone through and converted some of our custom ODBC crystal reports from E9 to E10. These work perfect from the Crystal Reports designer and from the client on my desktop, but on other computers I am getting the error 'a string is required here' after i fill in the parameters.

Has anyone run into this before?




I have seen something similar to this when I converted my V9 to V10. 


If you trace the error down - I would guess that it is pointing to a "Date" Field.  for some reason I had to convert some (not all) of my date fields to strings (or maybe it was the other way around).  I honestly do not remember specifically.


However, your problem does remind me that the problem was Date field related.


Sorry I wish I could be more specific,


DaveO


I found a piece of code that was giving me the error.  I had to "convert" the InvcHead.InvoiceDate field to a Date even though the parameter was a Date Type and the InvcHead.InvoiceDate was already defined as a date.  I suspect that in the conversion the type got changed from Date to Date/Time (or something like that).


If {?PM-CustNum} = 0 Then
    If HasLowerBound({?PM-DateRange}) Then
        If HasUpperBound({?PM-DateRange}) Then
            {InvcHead.Company} = "02" and
            Date({InvcHead.InvoiceDate}) >= Minimum({?PM-DateRange}) and
            Date({InvcHead.InvoiceDate}) <= Maximum({?PM-DateRange})
        Else // No Upper Bound
            {InvcHead.Company} = "02" and
            Date({InvcHead.InvoiceDate}) <= Maximum({?PM-DateRange})
    Else // No Lower Bound
        If HasUpperBound({?PM-DateRange}) Then
            {InvcHead.Company} = "02" and
            Date({InvcHead.InvoiceDate}) <= Maximum({?PM-DateRange})
        Else // No Upper Bound
            {InvcHead.Company} = "02"

Sorry - I forgot to mention that this code was from the Report Record selection formula editor.  Maybe this error only applies to record selections?


DaveO