473,408 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Crystal Reports formulas and Blank reports

I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.

Here's the formula (DateTransferred is a DateTime column):

If IsNull({MyReportDataSet.DateTransferred}) Then
" " //empty string
Else
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
" " //also pring an empty string - 1/1/1900 means "no date was
selected"
Else
ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");

It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.

I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.

I'd appreciate any help/advice

Using Crystal that comes w/ VS 2005

Jun 27 '08 #1
6 6562
On Jun 26, 12:18*pm, "G. Stoynev" <gstoy...@gmail.comwrote:
I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.

Here's the formula (DateTransferred is a DateTime column):

If IsNull({MyReportDataSet.DateTransferred}) Then
* *" " //empty string
Else
* *If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
* * * " " //also pring an empty string - 1/1/1900 means "no date was
selected"
* *Else
* * * ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");

It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.

I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.

I'd appreciate any help/advice

Using Crystal that comes w/ VS 2005
how do you know if isnull is returning true?
Jun 27 '08 #2
On Jun 26, 12:26*pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
On Jun 26, 12:18*pm, "G. Stoynev" <gstoy...@gmail.comwrote:


I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.
Here's the formula (DateTransferred is a DateTime column):
If IsNull({MyReportDataSet.DateTransferred}) Then
* *" " //empty string
Else
* *If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
* * * " " //also pring an empty string - 1/1/1900 means "no date was
selected"
* *Else
* * * ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");
It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.
I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.
I'd appreciate any help/advice
Using Crystal that comes w/ VS 2005

how do you know if isnull is returning true?- Hide quoted text -

- Show quoted text -
if I modify the formula like that (eliminate the problematic
expression)I see "no data" printed:
If IsNull({MyReportDataSet.DateTransferred}) Then
"no data" //empty string
Else
"some data"
Jun 27 '08 #3

"G. Stoynev" <gs******@gmail.comwrote in message
news:42**********************************@l64g2000 hse.googlegroups.com...
>I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.

Here's the formula (DateTransferred is a DateTime column):

If IsNull({MyReportDataSet.DateTransferred}) Then
" " //empty string
Else
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
" " //also pring an empty string - 1/1/1900 means "no date was
selected"
Else
ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");

It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.

I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.

I'd appreciate any help/advice
It seems to me that you should short-circuit the IF statement if IsNull
(remove the ELSE off the ISNull) and just come out of the formula return a
null string, a separate if for the null check.

If it's not ISNull, then do the other part of the formula, fall through.
Jun 27 '08 #4
On Jun 26, 1:14*pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"G. Stoynev" <gstoy...@gmail.comwrote in message

news:42**********************************@l64g2000 hse.googlegroups.com...


I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.
Here's the formula (DateTransferred is a DateTime column):
If IsNull({MyReportDataSet.DateTransferred}) Then
* " " //empty string
Else
* If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
* * *" " //also pring an empty string - 1/1/1900 means "no date was
selected"
* Else
* * *ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");
It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.
I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.
I'd appreciate any help/advice

It seems to me that you should short-circuit the IF statement if IsNull
(remove the ELSE off the ISNull) and just come out of the formula return a
null string, a separate if for the null check.

If it's not ISNull, then do the other part of the formula, fall through.-Hide quoted text -

- Show quoted text -
You mean:
If (IsNull({MyReportDataSet.DateTransferred})) Then
"no data";

If (Not IsNull({MyReportDataSet.DateTransferred})) Then
(
If ({MyReportDataSet.DateTransferred} <CDate("1/1/1900")) Then
"good data - date has been selected"
Else
"deliberately not selected";
)

??
Is there a way to force-exit from Crystal formula? Something like
"return;"?
Jun 27 '08 #5

"G.S." <gs******@gmail.comwrote in message
news:8b**********************************@34g2000h sf.googlegroups.com...
On Jun 26, 1:14 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"G. Stoynev" <gstoy...@gmail.comwrote in message

news:42**********************************@l64g2000 hse.googlegroups.com...


I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.
Here's the formula (DateTransferred is a DateTime column):
If IsNull({MyReportDataSet.DateTransferred}) Then
" " //empty string
Else
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
" " //also pring an empty string - 1/1/1900 means "no date was
selected"
Else
ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");
It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.
I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.
I'd appreciate any help/advice

It seems to me that you should short-circuit the IF statement if IsNull
(remove the ELSE off the ISNull) and just come out of the formula return a
null string, a separate if for the null check.

If it's not ISNull, then do the other part of the formula, fall through.-
Hide quoted text -

- Show quoted text -
You mean:
If (IsNull({MyReportDataSet.DateTransferred})) Then
"no data";

If (Not IsNull({MyReportDataSet.DateTransferred})) Then
(
If ({MyReportDataSet.DateTransferred} <CDate("1/1/1900")) Then
"good data - date has been selected"
Else
"deliberately not selected";
)

??
Is there a way to force-exit from Crystal formula? Something like
"return;"?
When you're in the language IDE for creating the formula is there *return*
there for the function you can choose? It's been many years since I last saw
Crystal.

That statement by itself will exit the formula if it's true and return "no
data", if I recall correctly.

If (IsNull({MyReportDataSet.DateTransferred})) Then
"no data";
I guess you got that email instead of this post, since I didn't get a not
delivered email.
Jun 27 '08 #6
On Jun 26, 2:33*pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"G.S." <gstoy...@gmail.comwrote in message

news:8b**********************************@34g2000h sf.googlegroups.com...
On Jun 26, 1:14 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:


"G. Stoynev" <gstoy...@gmail.comwrote in message
news:42**********************************@l64g2000 hse.googlegroups.com....
>I can't seem to be able to prevent a Crystal Reports formula to
evaluate an expression when the report contains no records to show.
Here's the formula (DateTransferred is a DateTime column):
If IsNull({MyReportDataSet.DateTransferred}) Then
" " //empty string
Else
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
" " //also pring an empty string - 1/1/1900 means "no date was
selected"
Else
ToText({MyReportDataSet.DateTransferred}, "MM/dd/yyyy");
It looks that even if IsNull returns true, Crystal is still trying to
evaluate this line
If ({MyReportDataSet.DateTransferred} = CDate("1/1/1900")) Then
which is causing the error "A date is required here" to be displayed.
I tried changing Report Options -Convert DBNull to Default, bub that
didn't help.
I'd appreciate any help/advice
It seems to me that you should short-circuit the IF statement if IsNull
(remove the ELSE off the ISNull) and just come out of the formula return a
null string, a separate if for the null check.
If it's not ISNull, then do the other part of the formula, fall through..-
Hide quoted text -
- Show quoted text -

You mean:
If (IsNull({MyReportDataSet.DateTransferred})) Then
* * "no data";

If (Not IsNull({MyReportDataSet.DateTransferred})) Then
(
* * If ({MyReportDataSet.DateTransferred} <CDate("1/1/1900")) Then
* * * * "good data - date has been selected"
* * Else
* * * * "deliberately not selected";
)

??
Is there a way to force-exit from Crystal formula? Something like
"return;"?

When you're in the language IDE for creating the formula is there *return*
there for the function you can choose? It's been many years since I last saw
Crystal.

That statement by itself will exit the formula if it's true and return "no
data", if I recall correctly.

If (IsNull({MyReportDataSet.DateTransferred})) Then
* * "no data";

I guess you got that email instead of this post, since I didn't get a not
delivered email.- Hide quoted text -

- Show quoted text -
Thank you for your help!
No, I didn't see a return statement in any of the canned functions/
operatorrs list in the IDE. The Crystal Reports help in VS2005 Help is
not helpful at all... I tried to guess a few times Exit, Return,
Stop... no avail.

I've used crystal enterprise in the past and have never encountered
that problem. This is typical Crystal stuff - not intuitive and hard
to debug/find help. Thanks again!
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
0
by: Matt Fuerst | last post by:
Greetings all, I'm having an issue with my Web application. It's deployed using Crystal Reports 8.0 Developer edition. I have an RPT file with a relatively large number of formulas (30+). I...
0
by: Dr. Indera | last post by:
hello, i previously posted the questions below on several crystal reports newsgroups, including the one for the company that makes crystal reports, but never got an answer, so i'm hoping that...
5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
1
by: Rashmi | last post by:
I am asked to do a project on crystal reports using vb.net. My module is MULTIPLE QUERIES. I'm a student and new to all this. I am asked to submit a report about my module and how I'll be designing...
5
by: Georgess | last post by:
Hi I have a problem with a crystal reports viewer I have developed with VS.Net 2003. Everything was working fine until I tried to view reports with suppression formulas... Eg. suppress (no Drill...
0
by: vingtquatre | last post by:
Ijust upgraded from Crystal Reports 6 to Crystal Report XI. Existing reports (lots of them) were converted apparently OK. (That is, they looked fine when viewed with Crystal's design preview)....
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.