Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Run inside Crystal works, running outside doesn't Post Reply Post New Topic
Author Message
BenWright
Newbie
Newbie


Joined: 04 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote BenWright Replybullet Topic: Run inside Crystal works, running outside doesn't
     Posted: 25 Jun 2014 at 1:27am

Hi,

I'm still doing battle with my delivery date report and I decided to revert to a much simpler report but now things have gone very weird.  If I run the report from Crystal 2008 end it works fine but if I run it from the database end it has a major issue and massively over counts some items.

When developing and run in Crystal it says 3 (I'm using DistinctCount({ADL_Loans.personID})) people have 4 (using Count({ADL_Loans.personID})) items delivered.  When embedded and run from the database it says 3 people have 53,156 items delivered!  We have never issued anywhere near that number.  This is somehow linked to a formula I am using to calculate delivery times as when I remove it from the report it correctly counts at the database end

 (datediff("d",{Referrals.FirstContactDate}, {ADL_Loans.Loaned_Date}) -

    DateDiff ("ww", {Referrals.FirstContactDate}, {ADL_Loans.Loaned_Date}, crSaturday) -

     DateDiff ("ww", {Referrals.FirstContactDate}, {ADL_Loans.Loaned_Date}, crSunday))

The annoying thing is I seem to recall it working about a month ago but I could be confusing it with another report.  It’s proving difficult to bugtest because I have to alter it in crystal then logon to our main database then run it from there and wait several minutes to get the output because of the massive overcount.  I've been altering the join types on the tables but nothing so far.

Has anyone ever experienced an issue where crystal gives the right output but when run elsewhere it’s wildy incorrect.  Is it a known issue perhaps? 

Ben

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Jun 2014 at 5:09am
Just the usual questions, 1) when you say you log into the database, are you meaning an application? Only because I have not run a Crystal Report from a database. 2) Are both the Crystal Report IDE and the database pointing to the same database? 3) Do both have the same rights or perhaps to put it another way, are both reports using the same user credentials to connect to the data?

these are the sort of things that have caused me errors in the past.
IP IP Logged
BenWright
Newbie
Newbie


Joined: 04 Jun 2014
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote BenWright Replybullet Posted: 25 Jun 2014 at 5:56am
Sorry for being unclear, I'm not sure of the proper terminology but here goes.

I'm not sure of the exact process but I believe it uses .net framework.  I link the application that is the database frontend to a saved crystal report and when clicked it will then ask for any parameters and usually run and output exactly as it would within Crystal.  This allows the application frontend user to run the custom reports I create.  Permissions are the same, user credentials are the same I believe.  There are hundred of reports I've linked to the application frontend and they all still work. 

I also have to ensure Crystal Reports Runtime redistributable is on each machine that has the database frontend.  Saying that maybe there is a more uptodate version of the redistributable so I'll have a look tomorrow.
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