Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: I need a Crystal Reports Exorcism please... Post Reply Post New Topic
Author Message
mlrosier
Newbie
Newbie


Joined: 21 Jan 2011
Online Status: Offline
Posts: 5
Quote mlrosier Replybullet Topic: I need a Crystal Reports Exorcism please...
     Posted: 24 Mar 2011 at 10:54am

I've got a good one here for you guys. I have a report that pulls data Year To Date, numbers based on Leads adn Sales. The report was pulling numbers for the wrong month in Production due to a formate change in a text field that is converted to a number, and then stripped down into two parts, one for Month, and one for Year.
I have the report working, and it pulls the data when I run it directly in Crystal on the Server.
It also works jut fine if I run it from Cystal on my local Machine.
Now here's where the weirdness comes in. We schedule our reports using Central Management Console through Internet Explorer using Crystal Reports Server. I published the Report to Crystal Reports Server and scheduled it to run and output in an Excel Document. When I open the document after it runs, all of the fields are Zero. No data gets pulled in.
If I set the ouput to Crystal Report and run it, I will open the report and it will also show all zeros for the data values. But when I hit refresh, it will pull in all of the appropriate data.
I have NO idea why it's doing this. The original Production Report pulls data in, but puts it in the wrong place, and the numbers are not correct. The new one will not pull in the data, but if you refresh it as a Crystal Report, it pulls in the data, and it is accurate. The ONLY two things that changed were two formula fields, one for Month and one for Year. And they were simple changes to simply trim for Month, and trim for Year off of a text field that is converted to a number with ToNumber. And like I said, if I run the report locally or directly on the server and output it to Excel or Crystal, the data is all there and accurate.
If this was Lotus Notes, which I SO wish it was, it would be an easy fix. I would just simply call a refresh at some point. Can't do that with crystal, just like you can't debug, which is another grudge in and of itself.

I would appreciate any help I can get. Has anyone else run into this with Crystal? This is Crystal 11.5 by the way.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 24 Mar 2011 at 11:08am
When you scheduled the report after fixing it, did you "Reschedule" or did you create a new schedule.  You must create a new schedule for it to work.
 
Are there any parameters for your report?  When scheduling, have you set all of the parameters?
 
-Dell
IP IP Logged
mlrosier
Newbie
Newbie


Joined: 21 Jan 2011
Online Status: Offline
Posts: 5
Quote mlrosier Replybullet Posted: 24 Mar 2011 at 11:23am

Yep, I've deleted the old schedule and rescheduled. I've even gone as far to delete the whole blasted thing from the server, and re-publish it, setting everything back up from scratch. This particular report does not use paramaters. And the only Selection it uses is based on date field.

I'm at the point now, where I'm just laughing at it, because there's no reason for it to be doing this.
 
In the original Production Report, the @Month and @Year fields looked at a field that was text that had a number format of "YYY,YMM".
The formula was a simple MID trim and then convert to a number. Something changed in the database and now that text field has a number formate of just "YYYYMM", and the @Month and @Year fields simply Right and Left trim and then convert to numbers to get year and month from that string.
I am stumped for sure.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Mar 2011 at 3:28am
Hmmm.....I'm stumped on this one as well....
 
-Dell
IP IP Logged
mlrosier
Newbie
Newbie


Joined: 21 Jan 2011
Online Status: Offline
Posts: 5
Quote mlrosier Replybullet Posted: 25 Mar 2011 at 10:37am
I've been looking at this some more, and from what I am seeing the reason for the report not picking up data is due to leading zeroes in the Month code that was in the report. I've changed the code, and this should work, but instead, when I schedule the report to run, I get an error message. Here are the details:
 
This is the code behind the Formula Field:
------------------------------------------
NumberVar TrimYear := ToNumber(Left(ToText({ACURA_INET_PURCHASE_SUMMARY.PERIOD}),4));
NumberVar TrimMonth := ToNumber(Right(ToText({ACURA_INET_PURCHASE_SUMMARY.PERIOD}),2));
StringVar TheDate := ToText(CDate(TrimYear,TrimMonth,01), "MM/dd/yy" );
DateVar TheFinalDate := Date(TheDate);
Month(TheFinalDate)
=======================================
This is the Error Message:
--------------------------

Error in formula <Month>. 'NumberVar TrimYear := ToNumber(Left(ToText({TABLESPACE.PERIOD}),4)); ' A month number must be between 1 and 12. Details: errorKind
=======================================
This is the what the data looks like in the database from the PERIOD field in the table:
------
{TABLESPACE.PERIOD} = 201102
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Mar 2011 at 11:33am
It looks like you're using the formula for year as month - year is left(4), month is right(2).
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum