Crystal Report performance - subreports or sql command?

Hello,
bit of quandary, I've an existing report that contains six subreports all sharing the same parameter to the main report, a 'projectID' field.
The main report approximately returns 300 records/projects and each of the 6 subreports are passed the corresponding 'projectID' field 300 times.
Now, I've succesfully incorporated the main report query and corresponding subreports into a TSQL command containing a number of subqueries in the Select clause:
SELECT   PROJECT.PROJECTID, PROJECT.TITLE, PROJECT.REFERENCE, PROJECTSTATUS.PROJECTSTATUS, PROJECT.INPUT_DATE
,(SELECT max(INPUT_DATE) FROM V_PROJECT_NOTE AS VPN
WHERE PROJECT.PROJECTID = VPN.PROJECTID) AS LastHeadline
,(SELECT
MAX(CASE
     WHEN MODIFIED_DATE IS NULL THEN INPUT_DATE
     WHEN INPUT_DATE > MODIFIED_DATE THEN INPUT_DATE
          ELSE MODIFIED_DATE
END) FROM ISSUE WHERE PROJECT.PROJECTID = ISSUE.PROJECTID) AS LastNewIssue
,(SELECT max(ISSUENOTE.INPUT_DATE) FROM ISSUE
INNER JOIN ISSUENOTE ON ISSUE.ISSUEID = ISSUENOTE.ISSUEID
WHERE PROJECT.PROJECTID = ISSUE.PROJECTID ) AS LastIssueNote 
,(SELECT max(modified_date) FROM V_PROJECT_RISK_LAST_AMMENDED AS VPR
WHERE PROJECT.PROJECTID = VPR.PROJECTID) AS LastRiskLogUpdate
,(SELECT max(INPUT_DATE) FROM PROJECT_CHECKLIST AS PC
WHERE PROJECT.PROJECTID = PC.PROJECTID) AS LastChecklistUpdate
,(SELECT max(input_date) FROM V_PROJECT_ACTIVITY_LAST_AMMENDED AS VPA
WHERE PROJECT.PROJECTID = VPA.PROJECTID) AS LastGANTTUpdate 
,V_PROJECT_KEYCONTACT.USERNAME AS KeyContact
,(SELECT     USERPROFILE.USERNAME AS Supervisor
FROM         USERPROFILE INNER JOIN
                      PROJECT_MEMBER AS SUPERVISOR ON USERPROFILE.USERID = SUPERVISOR.USERID RIGHT OUTER JOIN
                      PROJECT_MEMBER AS KEYCONTACT ON SUPERVISOR.PROJECT_MEMBERID = KEYCONTACT.PARENTID
WHERE PROJECT.PROJECTID = KEYCONTACT.PROJECTID
AND KEYCONTACT.KEY_CONTACT =1) AS Supervisor
FROM         PROJECT INNER JOIN
                      PROJECTSTATUS ON PROJECT.PROJECTSTATUSID = PROJECTSTATUS.PROJECTSTATUSID LEFT OUTER JOIN
                      V_PROJECT_KEYCONTACT ON PROJECT.PROJECTID = V_PROJECT_KEYCONTACT.PROJECTID
WHERE V_PROJECT_KEYCONTACT.USERNAME IN ('aaa','bbb','ccc')
AND (PROJECTSTATUS.PROJECTSTATUS IN ('111', '222', '333'))
AND ((PROJECT.TITLE NOT LIKE 'xxx%') AND (PROJECT.TITLE NOT LIKE 'yyy%') AND (PROJECT.TITLE NOT LIKE 'zzz%'))
ORDER BY V_PROJECT_KEYCONTACT.USERNAME, PROJECT.INPUT_DATE
Now, I've run both SQL Server Profiler and looked at the Performance Information in Crystal and the SQL command method is an order of magnitude less efficient!!
I may have to post my query on a TSQL forum but was wondering if anyone on here can possible shed any light on it?
Thanks in advance,
Dom

Dom,
I assume that the last edit was to remove a few curse words...
The reality is that we can give a good explanation as to why the sub-report version would execute faster that the command version w/o seeing the report (with the sub-reports included).
Looking at the SQL, I can tell that it's a fairly expensive query, firing several sub-queries for every row returned by the outer query. That said, I sounds like the same thing is taking place with the sub-report version too... So I would think that the performance would be similar.
The only thing that I can think of, and this is just a guess... With the sub-report version, each all queries are being run independently and then combined locally by CR, whereas the command version, everything is combined. The more complex the query, the harder the optimizer has to work to come up with the best execution plan... and the greater the likelihood that that the resulting plan isn't as optimized as it could be.
That said, I'd still think the command version would be faster over all. Are you seeing real differences between the two reports, in the amount of time that it takes from refresh to final render?
Either way, I think moving all of those sub-queries from the select list (where they are executing once for every row) down to the FROM area (where they only have to execute once) should increase the speed dramatically and surpass the sub-report version by a decent margin.
Give this version of your SQL a test drive and see if it yields an improvement.
SELECT  
PROJECT.PROJECTID,
PROJECT.TITLE,
PROJECT.REFERENCE,
PROJECTSTATUS.PROJECTSTATUS,
PROJECT.INPUT_DATE,
VPN.LastHeadline,
ISSUE.LastNewIssue,
ISSUE_NOTE.LastIssueNote,
VPR.LastRiskLogUpdate,
PC.LastChecklistUpdate,
VPA.LastGANTTUpdate,
V_PROJECT_KEYCONTACT.USERNAME AS KeyContact,
Supervisor.Supervisor
FROM PROJECT
INNER JOIN PROJECTSTATUS ON PROJECT.PROJECTSTATUSID = PROJECTSTATUS.PROJECTSTATUSID
LEFT OUTER JOIN V_PROJECT_KEYCONTACT ON PROJECT.PROJECTID = V_PROJECT_KEYCONTACT.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     max(INPUT_DATE) AS LastHeadline
     FROM V_PROJECT_NOTE
     GROUP BYPROJECTID) AS VPN ON PROJECT.PROJECTID = VPN.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     MAX(CASE
          WHEN MODIFIED_DATE IS NULL THEN INPUT_DATE
          WHEN INPUT_DATE > MODIFIED_DATE THEN INPUT_DATE
          ELSE MODIFIED_DATE END) AS LastNewIssue
     FROM ISSUE
     GROUP BY PROJECTID) AS ISSUE ON PROJECT.PROJECTID = ISSUE.PROJECTID
LEFT OUTER JOIN (
     SELECT ISSUE.PROJECTID,
     max(ISSUENOTE.INPUT_DATE) AS LastIssueNote
     FROM ISSUE
     INNER JOIN ISSUENOTE ON ISSUE.ISSUEID = ISSUENOTE.ISSUEID
     GROUP BY ISSUE.PROJECTID) AS ISSUE_NOTE ON PROJECT.PROJECTID = ISSUE_NOTE.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     max(modified_date) AS LastRiskLogUpdate
     FROM V_PROJECT_RISK_LAST_AMMENDED
     GROUP BY PROJECTID) AS VPR ON PROJECT.PROJECTID = VPR.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     max(INPUT_DATE) AS LastChecklistUpdate
     FROM PROJECT_CHECKLIST
     GROUP BY PROJECTID) AS PC ON PROJECT.PROJECTID = PC.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     max(input_date) AS LastGANTTUpdate
     FROM V_PROJECT_ACTIVITY_LAST_AMMENDED
     GROUP BY PROJECTID) AS VPA ON PROJECT.PROJECTID = VPA.PROJECTID
LEFT OUTER JOIN (
     SELECT PROJECTID,
     USERPROFILE.USERNAME AS Supervisor
     FROM USERPROFILE
     INNER JOIN PROJECT_MEMBER AS SUPERVISOR ON USERPROFILE.USERID = SUPERVISOR.USERID RIGHT
     OUTER JOIN PROJECT_MEMBER AS KEYCONTACT ON SUPERVISOR.PROJECT_MEMBERID = KEYCONTACT.PARENTID
     WHERE KEYCONTACT.KEY_CONTACT =1) AS Supervisor ON PROJECT.PROJECTID = Supervisor.PROJECTID
WHERE V_PROJECT_KEYCONTACT.USERNAME IN ('aaa','bbb','ccc')
AND (PROJECTSTATUS.PROJECTSTATUS IN ('111', '222', '333'))
AND ((PROJECT.TITLE NOT LIKE 'xxx%')
AND (PROJECT.TITLE NOT LIKE 'yyy%')
AND (PROJECT.TITLE NOT LIKE 'zzz%'))
ORDER BY V_PROJECT_KEYCONTACT.USERNAME, PROJECT.INPUT_DATE
HTH,
Jason

Similar Messages

  • Query Engine report error with Crystal Report 9 And MS SQL SErver 2000

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...
    Refer the above statement highlighted in BOLD. That statement is WRONG. Select what ???? Try any one of the below statement,
    select ''
    --or
    select 0
    --or
    select null
    Regards, RSingh

  • Without using SubReport or SQL Command in Main Report, get desired results without duplicating

    It seems so simple.  I just need the cost, at a certain time (based on a parameter), for each item.  I wrote a SQL Command that works beautifully, but when it connects to the existing report, it slows to a horrible crawl and cannot be used for tables with over 4 million records.  Here is the SQL Command that provides the desired results:
    SELECT TOP 1 WITH TIES "INVENTITEMPRICE"."ITEMID", "INVENTITEMPRICE"."PRICETYPE", "INVENTITEMPRICE"."MARKUP", "INVENTITEMPRICE"."PRICEUNIT", "INVENTITEMPRICE"."PRICE", "INVENTITEMPRICE"."PRICEQTY", "INVENTITEMPRICE"."ACTIVATIONDATE", "INVENTITEMPRICE"."DATAAREAID"
    FROM ("AX09PROD"."dbo"."INVENTITEMPRICE" "INVENTITEMPRICE" INNER JOIN "AX09PROD"."dbo"."INVENTTABLE" "INVENTTABLE" ON (("INVENTITEMPRICE"."ITEMID"="INVENTTABLE"."ITEMID") AND ("INVENTITEMPRICE"."DATAAREAID"="INVENTTABLE"."DATAAREAID")))
    WHERE  ("INVENTITEMPRICE"."DATAAREAID"=N'TMC' AND "INVENTITEMPRICE"."PRICETYPE"=0 AND "INVENTITEMPRICE"."ACTIVATIONDATE"<={?As Of Date})
    ORDER BY ROW_NUMBER () OVER(PARTITION BY "INVENTITEMPRICE"."ITEMID" ORDER BY "INVENTITEMPRICE"."ACTIVATIONDATE" DESC)
    I've attached the report with saved data.  However, when I remove the restrictions of just certain items, it is unusable as it is SO SLOW!
    I can also get the desired results from using a subreport but it takes forever to export due to the number of records/items.  Whenever possible, I avoid subreports for this reason.  I've attached that report with data as well.
    Please be patient as I'm not savvy in SQL, but decent in generating reports.  What am I doing wrong?  This seems SO simple.  The premise is that I want the corresponding information based on the date entered:  If the date entered is 3/15/2014, the result should be 91.15 as indicated below.  I'd simply like this value to be placed in a formula per item.
    Item 80014:
    Activation Date
    Cost Price
    6/2/2014
    104.43
    4/1/2014
    91.58
    3/1/2014
    91.15
    2/1/2014
    92.89
    1/1/2014
    93.57
    Any assistance would be GREATLY appreciated!
    Thanks!
    Teena
    Update:  I was unable to attach the reports with .rpt or .txt extensions.  There were well under 1MB.  Any suggestions?

    hi Teena,
    if you're going the inline subquery route, try something like the following...the last line in the sub-query 'where' clause should in theory take care of matching the correct price based on relating the item id's between your cost price & inventory data. this should leave you with distinct values for each itemid then. hopefully it won't error out as i'm just guessing on the syntax.
    SELECT DISTINCT
    "INVENTTABLE"."ITEMID",
    "INVENTTRANS"."DATAAREAID",
    "INVENTTRANS"."DATEPHYSICAL",
    "INVENTTRANS"."QTY",
    "INVENTTABLE"."ITEMGROUPID",
    "INVENTTABLE"."ITEMNAME",
    "INVENTTRANS"."TRANSREFID",
    "INVENTTRANS"."STATUSISSUE",
    "INVENTTABLE"."ITEMTYPE",
    "INVENTTRANS"."TRANSTYPE",
    "INVENTTRANS"."RECID",
    "INVENTTRANS"."DIRECTION",
    SELECT TOP 1 "INVENTITEMPRICE"."PRICE"
    FROM "AX09PROD"."dbo"."INVENTITEMPRICE" "INVENTITEMPRICE"
    WHERE  "INVENTITEMPRICE"."DATAAREAID" LIKE 'TMC%'
    AND "INVENTITEMPRICE"."PRICETYPE"=0
    AND "INVENTITEMPRICE"."ACTIVATIONDATE"<={?As Of Date}
    AND "INVENTITEMPRICE"."ITEMID" = "INVENTTABLE"."ITEMID"
    ORDER BY "INVENTITEMPRICE"."ACTIVATIONDATE" DESC
    ) AS ITEMPRICE
    FROM  
    "AX09PROD"."dbo"."INVENTTABLE" "INVENTTABLE"
    LEFT OUTER JOIN "AX09PROD"."dbo"."INVENTTRANS" "INVENTTRANS"
    ON ("INVENTTABLE"."DATAAREAID"="INVENTTRANS"."DATAAREAID")
    AND ("INVENTTABLE"."ITEMID"="INVENTTRANS"."ITEMID")
    WHERE 
    "INVENTTRANS"."DATAAREAID" LIKE 'TMC%'
    AND (("INVENTTABLE"."ITEMGROUPID" LIKE 'RAW%') OR ("INVENTTABLE"."ITEMGROUPID" BETWEEN '000' AND '999') OR ("INVENTTABLE"."ITEMGROUPID" LIKE 'Ship_Box'))
    AND "INVENTTABLE"."ITEMTYPE" IN (0,1)
    ORDER BY 
    "INVENTTABLE"."ITEMGROUPID",
    "INVENTTABLE"."ITEMID",
    "INVENTTRANS"."DATEPHYSICAL" ASC
    Message was edited by: Jamie Wiseman

  • Crystal Report with subreports breaks when running on different databases.

    HI there
    I have a report with 5 subreports on that only works on the database I am designing it on. As soon as I run the report through my application on a database different to the one I design on, it seems to have lost all the parameter fields I created in one of the subreports (the one I have just added, the other 4 work fine) used to link to the main report.
    It then pops up with the Parameter Value box and asks for values for 2 parameters that I do not use to link to the subreport, nor have added to the subreport in design time, and in code when I step through the parameterfields list property, the parameters I added in design time to the subreport are not in the list but somehow these 2 parameter fields have been added to the subreport? These 2 parameters have the same names as some main report parameters which have been set already, but as mentioned these somehow now belong to the subreport.
    When I run the report through my app on the database I design on all parameters are present and the report works fine.
    The parameters in the subreport are all command parameters, linking to a command field, a formula field and another non-command parameter in the main report. All these are set and work fine in the main report.
    I set all the parameter values in code to the main report, and the subreports all use those to link to.
    I am using CR v10.2 with VB2008 using .NET 2.0 framework (although I had similar problems in VB2005), where the report links directly to a SQL databse via commands. There are 4 commands in the main report and one in the problematic subreport. The subreports command incudes a SQL "IF" statement based on one of the parameters I am linking from the main report.
    Please let me know if more info is required.
    Thanks.

    Hello, Eugen;
    I understand you are using Visual Studio .NET 2008 with bundled Crystal Reports Basic for 2008 (10.5). Do you have a full version of Crystal Reports you use to design reports with or are you designing inside Visual Studio .NET?
    I would like to suggest some ways to test and narrow down the issue.
    One subreport appears to be changing the parameters used when the underlying database changes. Is there a change in the Command it is based on?
    Create a simple report using the same command and the same database as is used in the problem subreport. Run it to confirm you get the same data as in the original.
    Now in design, go into Database|Set Datasource location and change to the new datasource. Do a Database|Verify database. Do you see the change in parameter fields you are seeing at runtime? Has the Command changed? Does it run through the application?
    If you see the same change there, it will have to be addressed in the designer first. If it runs well there, let us look further at the application.
    What is the order of your code?
       Open main report
       Logon to database
       Pass parameters
       Open each subreport
       Logon to the database
       Pass parameters
       View the report.
    Do you set all database locations before passing parameters?
    Were any of the parameters created as "NULL" in the designer?
    Once I have the answers to these questions we can look a little further.
    Elaine

  • Crystal reports 10 and Enterprise sql nolock

    Post Author: Dis1931
    CA Forum: Data Connectivity and SQL
    Occasionally we have an issue where it seems the Crystal Reports Enterprise server causes a lock on one of our databases.  Doesn't happen all the time and we have not been able to narrow it down.  This prevents all users from connecting to the database and working...this is obviously not good.  When we find out we kill the PID in sql that is causing the lock.  Then all is fine. 
    My question is whether there is a way to perform a query using nolock in Crystal Reports 10 or of configuring it on the Enterprise server?  Is this called something else in Crystal? 
    I realize that this could lead to reading uncommitted data or that data may change while I am reading it, etc...but I would rather have a bad report every once in a while than to have it lock up the database every once in a while.  If there are other problems resulting from using nolock or a similar command let me know.  Is this possible? 
    I looked into connection strings as well and couldn't find a way to specify locking or in this case no locking. 
    I would change the SQL query in Crystal Reports but this functionality seems to have been removed since version 8.5.  If there is a way to edit the query directly that would be acceptable as well.
    Any help would be greatly appreciated.  Thanks in advance.

    Post Author: kevans
    CA Forum: Data Connectivity and SQL
    Did you ever find a solution to this?  I just upgraded from Crystal 8 to 10 and of course didn't discover this issue during my testing, never thought of it, but then locks (in sql it shows as blocking) started showing up during production locking people out of the database and bringing production to a hault.  I have searced for two days and cannot find a way to stop this, I was hoping there was a setting in Crystal to preventing blocking, or maybe something I could add to the select statement, someone said I could add 'noblock' but I can't find any info on this.

  • Crystal Report Performance for dbf files.

    We have a report which was designed 5 -6 years ago. This report has 4 linked word doc and dbf file as datasource. This report also as 3 subreports. The size of field in dbf is 80 chars and couple of field are memo field. The report performance was excellent before we migrated the crystall report to 2008. After CR2008 the system changed and it is suddenly really slow. We have not change our reports so much it should have an influence on performance. When the user presses the preview button on printing tool window the control is transferred to Crystal. Something has happened inside black box of Crystal ( IMO ).   the dll we have are crdb_p2bxbse.dll 12.00.0000.0549 . The issues seems to be of xbase driver (not possible to use latest version of crdb_p2bxbse.dll and dbase files with memo fields).

    Hi Kamlesh,
    Odd that the word doc is opened before the RPT, I would think that the RPT would need to be opened first so it sees that the doc also needs to be opened. Once it's been loaded then the connection can be closed, CR embeds the DOC in the RPT so the original is no longer required.
    Also, you should upgrade to Service Pack 3, it appears you are still using the original release. SP1 is required first but then you should be able to skip SP2 and install SP3.
    You did not say what earlier version of Cr you were using? After CR 8.5 we went to full UNICODE support at which time they completely re-built the report designer and removed the database engines from the EXE and made them separate dll's now. OLE objecting also changed, you can use a formula and database field to point to linked objects now so they can be refreshed any time. Previously they were only refreshed when the report was opened.
    You may want to see if linking them using a database field would speed up the process. Other than that I can't suggest anything else as a work around.
    Thank you
    Don

  • How to interpret or calculate Crystal Report Performance Timing?

    HI,
    I have been trying to interpret the Performance Information/Performance Timing of a Crystal Report. When I access this information from Crystal designer menu I see several fields but I don't know exactly which one gives you the total execution time in miliseconds or how do you calculate the total time using the fields.
    Help to interpret the following information will be appreciate. Example:
    MainReport.rpt
    Open Document:   0 ms  
    Run the Database Query:   703 ms  
    Read Database Records:   92 ms  
    Format First Page:   949 ms  
    Number of pages formatted:   2   
    Average time to format a page:   474 ms  
    Number of page starts generated:   13   
    Average time to generate a page start:   13 ms  
    Subreport.rpt
    Run the Database Query:   4 ms   For all instances
    Read Database Records:   2 ms   For all instances
    Number of page starts generated:   3   
    Average time to generate a page start:   0 ms   For all instances
    Number of subreport instances formatted:   1   
    Time to format all subreport instances:   38 ms
    Thanks!

    Have you seen this post:  [Needing to monitor the report run time and produce the dates/time on my rpt;

  • Slow Report Load Speed with SQL Command

    I have the following SQL Command in my Crystal Report.  When I add the "SalesOrderDeliveries.omdDeliveryDate" to the report it examines 240,000 records and takes 3 minutes to completely load the report.  However, if I do not include this, it only examines 137,000 and only takes 10 seconds to run.
    Why is this slowing down the report and running through more records than when it is omitted from the report?
    SELECT
      SalesOrderDeliveries.omdDeliveryDate,
      SalesOrderDeliveries.omdSalesOrderID,
      Jobs.jmpJobID
    FROM dbo.Jobs
    INNER JOIN dbo.SalesOrderJobLinks
      ON Jobs.jmpJobID = SalesOrderJobLinks.omjJobID
    INNER JOIN dbo.SalesOrders
      ON SalesOrderJobLinks.omjSalesOrderID = SalesOrders.ompSalesOrderID
    INNER JOIN dbo.SalesOrderLines
      ON SalesOrders.ompSalesOrderID = SalesOrderLines.omlSalesOrderID
    INNER JOIN dbo.SalesOrderDeliveries
      ON SalesOrderLines.omlSalesOrderID = SalesOrderDeliveries.omdSalesOrderID
    WHERE SalesOrderDeliveries.omdShippedComplete = 0
    AND Jobs.UJMPPMTRACK = -1
    GROUP BY Jobs.jmpJobID,
             SalesOrderDeliveries.omdDeliveryDate,
             SalesOrderDeliveries.omdSalesOrderID
    ORDER BY SalesOrderDeliveries.omdSalesOrderID

    Try doing something like this for your query:
    SELECT
      qryNextDate.nextDate,
      qryNextDate.omdSalesOrderID,
      Jobs.jmpJobID
    FROM dbo.Jobs
    INNER JOIN dbo.SalesOrderJobLinks
      ON Jobs.jmpJobID = SalesOrderJobLinks.omjJobID
    INNER JOIN dbo.SalesOrders
      ON SalesOrderJobLinks.omjSalesOrderID = SalesOrders.ompSalesOrderID
    INNER JOIN dbo.SalesOrderLines
      ON SalesOrders.ompSalesOrderID = SalesOrderLines.omlSalesOrderID
    INNER JOIN (
      select omdSalesOrderID, min(omdDeliveryDate) as nextDate
      from dbo.SalesOrderDeliveries
      where omdShippedComplete = 0
      group by omdSalesOrderID) as qryNextDate
      ON SalesOrderLines.omlSalesOrderID = qryNextDate.omdSalesOrderID
    where Jobs.UJMPPMTRACK = -1
    ORDER BY SalesOrderDeliveries.omdSalesOrderID
    This will get you just the minimum delivery date for each order, which should be the "next" due date.
    -Dell

  • Crystal Reports performance is too slow

    Dear SDNers,
    I have designed a crystal report which is fetching data from a Z developed function module. From crystal report side, used filters.But while executing report, it is calling the function module multiple times.
    due to this performance is very bad. Why report is calling mutiple times of the function module. Do need to modify from crystal report side or from function module side. Please clarify.
    Regards,
    Venkat

    A similar issue was seen a year ago It was regarding a function module call being executed multiple times from  CR4Ent tool. It involved the usage of sub reports inside that report and the issue was generic for any function module used for testing.
    At that time, the issue was resolved by upgrading to the latest available patch of CR4Ent and also by applying the latest patch at SAP R3 end.
    If you are able to post the exact support package and patch level of CR4Ent and also for the SAP R3 system, then someone can tell whether its the latest or not.
    -Prathamesh

  • Crystal Report 8.5 with SQL SERVER 2005 problems

    Post Author: AREVA
    CA Forum: Data Connectivity and SQL
    Hi All !We have some problems with Crystal Reports version 8.5 with SQL Server 2005: 1) When we want to generate a report (using data in SQL Server 2005) we have a popup message error : "impossible to loaded pdssql.dll".2) If we want to use SQL Server 2005, which Crystal Reports version we must used ? Is there any restrictions with this connectivity with 8.5 version ?Please, let me known, all informations about SQL Server 2005 and Crystal Report 8.5.Thanks for all !Best regards Anthony

    Hello Kamlesh,
    There is no expectation that the ActiveX viewer (RDC?) from CR8.5 will work in any version of Visual Studio .NET. There is also no expectation that the ActiveX viewer from CR8.5 will work on a machine with a 64 bit operating system.
    You're using VS2008. You should migrate to the bundled edition of CR for VS2008 (v10.5), the ReportDocument object, and the .NET Windows form viewer or Web form viewer.
    Sincerely,
    Dan Kelleher

  • How to create a crystal Report using C# and SQL Server

    Hi, im new in creating crystal report using SQL Server, and im making a project.. and could someone help me how to connect your .sdf (SQL Server File) from the bin to your crystal report? thanks a lot.. i followed some instructions like this one (https://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?forum=csharpgeneral)
    but i got an error on the adding of server name and database portion.. thanks a lot in advance

    Hello,
    Crystal Reports are supported on
    http://scn.sap.com/community/crystal-reports.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Test Connection failed in Crystal Reports for Eclipse using SQL Server 2008

    I installed an SQL Server Express 2008 on my local PC (Window XP SP3). I downloaded sqljdbc4.jar to Crystal Reports for Eclipse
    IDE library path and tried to Test Connection, but got the Ping failed message : The TCP/IP connection to the host localhost, port 1433 has failed. It said that check that an instance of SQL Server is running on the host (I saw SQL Server SQLEXPRESS is Running on my PC) and accepting TCP/IP connection at the port (I enabled TCP/IPin my PC's SQL Server Network Configuration),
    and that no firewall is blocking TCP connection to the port(I turned OFF Window Firewall on my OC). Can anyone tell me how can I fix this problem ?

    Hi,
    Check the below thread also:
    http://scn.sap.com/thread/1634856
    Thanks,
    DJ

  • How to write SQL in crystal report that can reuse SQL execution plan cache?

    I write the following SQL with crystal report parameter fields, and it is connecting to SQL 2005
    Select Name from Customer where CustID = '{?CustID}'
    The SQL profiler show that It is an ad-hoc query, how to write parameterized SQL which can reuse Execution Plan.
    Edited by: Chan Yue Wah on May 14, 2009 3:17 AM

    Since there are too many report, it is not possible rewrite all. Is that crystal report do not have option to change how it query the database ?

  • Scheduling Crystal Report with Subreport in BOE 12.0.0.683

    I have scheduled a crystal report in BOE that contains a subreport. The report successfully completes, but the data for the subreport is blank. I know there are records for the subreport because they are there when I run the subreport manually in crystal. Is there a way to fix this?

    hi,
    You can set the Idle connection time out parameter to desired value (in minutes) for Processing server using CMC.
    Regards,
    Vamsee

  • Login error with report viewer when opening Crystal report with subreport

    Hi
    I have a problem with a login error (database vendor code 18456) when I try to open a crystal report to view it.
    The report uses data from an external payroll database but I'm running it via our Accounts system (it's a convenient front end for users to run the report from). This works fine for another report that doesn't have any subreports. However when I run the Crystal report that has subreports, the report generation process works but when the crystal reports viewer tries to open the report I get the login error. It doesn't seem to be passing the login details for the payroll database down to the subreport.
    I'm using Crystal Reports version 11.0.0.1282. The Accounts system is Technology One. Tech One have provided a report template that has several formulas designed to allow Tech One to play nicely with Crystal. One of these formulas allows me to enter the nickname of the external database that the report needs to use. The external database's connection details are fully specified in the Tech One configuration section (server console). So in this case the report says use database U1 & the server console identifies U1 as being the payroll database, specifies the connection path  & has the username & password required to logon to the payroll database/server.
    The report is running ok & retrieving data, but for some reason the viewer is erroring. If anyone has any ideas for how I can get the login details used to run the main report to flow through to the subreport it would be much appreciated.
    Thanks
    Sue

    I understand your  frustration. We can do a few things. But really, it should be Technology One contacting us. To use an analogy (which you are free to share with Technology One). They built a car and sealed the hood. You bought the car, but he engine does not quite run as it should. You bring the car to the mechanic and all he can do is look at the car as he can not even open the hood.
    In any case, here is what I would do if I could open the hood (e.g.; if I was dealing with Technology One):
    1) Look up database vendor code 18456. This is simply the error our print engine is receiving from the database client and it simply passes it through relatively unhandled. This you should be able to do your self or ask Technology One to tell you what that means.
    2) Break out the subreport and see if it runs on it's own in the application (if this is a permissions issue - which I doubt -  it should come up here too). Unfortunately, this is for Technology One to do...
    3) Run the report (with the subreport) in the CR designer. Does it work there? If this is a win app and it works, we again eliminated permission issues. And we also confirmed that the report is good. Again, Technology One should do this for you.
    BTW.; CR 11.0 is out of support - not sure if you or Technology One are aware of this...
    4) Can the developer duplicate the issue on his development computer?
    Now, there are couple of instances where you say something like; "the report works and gets data, but the viewer errors out":
    +The report is running ok & retrieving data, but for some reason the viewer is erroring.
    However when I run the Crystal report that has subreports, the report generation process works but when the crystal reports viewer tries to open the report I get the login error.  +
    How do you know the report is retrieving data? From the error I would say the report never connects, thus the error / request for a logon...
    So, the short of all of this is; get Technology One to contact us. They can do it over the forums or obtain a phone case here;
    http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100
    Now, here is a warning. As CR 11.0 is out of support Technology One will have to upgrade to CR 11.5, before that can create a phone case, which for them and you brings up another bunch of issues...
    If you do not get any joy from the support person at you are talking to at Technology One, get him to escalate the issue. They are the ones that should be talking to us...
    Ludek

Maybe you are looking for