Sunday, March 11, 2012

Crystal Report locks up

ok, i am stumped, i don't know what to do with this problem. here is what's going on. i have the following tables in my report:

INCOMINGORDER: {IncomingOrderID, StudentID,....}
ORDERITEM: {OrderItemID, IncomingOrderID, CourseRecordID..}
COURSERECORD: {CourseRecordID, StudentID,...}
STUDENT: {StudentID, FName, LName, Address,..}

The fields with the same names in different tables are foreign keys, ex: ORDERITEM.IncomingOrderID is a foreign key pointing to INCOMINGORDER.IncomingOrderID, and so on.

So in my report i have the following sections:

............
Group Header ORDERITEM.IncomingOrderID
Group Header ORDERITEM.CourseRecordID
Details
Group Footer ORDERITEM.CourseRecordID
Group Footer ORDERITEM.IncomingOrderID
.................

In other words, first i group by the field ORDERITEM.IncomingOrderID and then by the field ORDERITEM.CourseRecordID.

In my record selection formula i have this:

{COURSERECORD.COURSERECORDID} = {ORDERITEM.COURSERECORDID} and
{INCOMINGORDER.BILLINGTYPEID} = 7.00

which works fine, but the problem is that when i try to add the line
{STUDENT.STUDENTID} = {INCOMINGORDER.STUDENTID} to link the tables STUDENT and INCOMINGORDER, my report just locks up. And if i try to add the above link in the visual link expert in Crystal Reports.NET i get error: "Query Engine Error", which is odd since INCOMINGORDER.STUDENTID is a foreign key pointing to STUDENT.STUDENTID.

Anybody has explanation for this?
Thanks.ok, a quick update on my post: i was apparently wrong about the report locking up. It did not lock up, it just took a really long time to load, 6 minutes to be exact. Clearly, that's unacceptable. Anyway, what i noticed was that the more conditions i added to my record selection formula, the longer it took for it to load. Initially my record selection was something like this:

{INCOMINGORDER.INCOMINGORDERID} = 202

In this case it loaded fairly quickly, almost no load time. Then i added one more condition:

{INCOMINGORDER.INCOMINGORDERID} = 202 and
{SHIPPABLEITEM.SHIPPABLEITEMID} = {ORDERITEM.SHIPPABLEITEMID}

Still, decent execution time. Then one more condition:

{INCOMINGORDER.INCOMINGORDERID} = 202 and
{SHIPPABLEITEM.SHIPPABLEITEMID} = {ORDERITEM.SHIPPABLEITEMID} and
{STUDENT.STUDENTID} = {INCOMINGORDER.STUDENTID}

A little slower this time, but still acceptable. And then i added the last condition:

{INCOMINGORDER.INCOMINGORDERID} = 202 and
{SHIPPABLEITEM.SHIPPABLEITEMID} = {ORDERITEM.SHIPPABLEITEMID} and
{STUDENT.STUDENTID} = {INCOMINGORDER.STUDENTID} and
{COURSERECORD.COURSERECORDID} = {ORDERITEM.COURSERECORDID}

So that took a really long time to load. As i inserted some of the fields i wanted displayed in the report, it got as long as 6 minutes.
Anybody know what the cause of this could be? I wonder if it's because i am using a DataSet, i don't seem to recall having similar problems with direct database access.

Thanks.|||Hi,

I think there is no need to give

{SHIPPABLEITEM.SHIPPABLEITEMID} = {ORDERITEM.SHIPPABLEITEMID} and
{STUDENT.STUDENTID} = {INCOMINGORDER.STUDENTID} and
{COURSERECORD.COURSERECORDID} = {ORDERITEM.COURSERECORDID}

these lines. They are automatically linked. Right?|||actually no, they are not linked since when i tried to do so in the Visual Linking Expert i got the following error: "Query Engine Error". i didn't know how to fix it so instead i set up the links in the record selection formula.

No comments:

Post a Comment