Site Search:
Sign in | Join | Help
4Penny.net

Crystal Reports

Notes, Tips and Tricks on Developing using Crystal Reports
  • Crystal in VB Deployment Projects (Visual Studio 2008)

    In Visual Studio 2008, merge modules are no longer used for crystal reports controls.

     To add the crystal reports files:

    1.  Go to the deployment project's properties page.
    2.  Click the "Prerequisites" button.
    3.  Add the "Crystal Reports Basic for Visual Studio 2008"

    It may also require the "Windows Installer 3.1"

  • Calculating the 'count' of occurances in Crystal

    From a recent email: 

    I am creating a Crystal report where I want a count of invoices that have backorders.  I have tried creating a formula field that returns a 1 or 0 if the sum of quantity backordered for an order is greater than 0.  This works fine but I cannot sum this field for the report to give me a total count.  Can you think of a way to do this?

    Answer:

    The answer is to use either a ‘count’ aggregation, or a ‘running total’, depending how the report is set up.

    The easiest is a ‘count’, you just right click on a field and choose ‘insert summary’. Then under ‘Calculate this summary’, change ‘sum’ to ‘count’. Carefully choose the ‘summary location’ If you’re in Crystal 11, it’s much easier to check ‘add to all group levels’ and then delete the ones that you don’t need.

    Depending on how you have the report set up, the 'count' may not work (if you are displaying invoice detail, you don't want the count of all those rows). in that case, you'll have to use the 'running total' functionality. If you have to do that, let me know, I'll walk you through it.

    I don't see a way to make the 'running total' option work if you are using tables brought into Crystal, but if you base the Crystal report on a stored procedure, you can do it that way. You need an ORDER level field that indicates if a LINE ITEM in that order has a backorder - like this:

     select h.sopnumbe,
      h.soptype,
      l.itemnmbr,
      l.quantity,
      l.qtytbaor,
      case when bo.sopnumbe is null then 0 else 1 end as hasBackOrder
     from sop10100 h with (nolock)
      join sop10200 l with (nolock) on l.sopnumbe = h.sopnumbe and l.soptype = h.soptype
      left join (select sopnumbe, soptype
        from sop10200 with (nolock)
        where qtytbaor <> 0
        group by sopnumbe, soptype
        ) as bo on bo.sopnumbe = h.sopnumbe and bo.soptype = h.soptype
     where 
      h.voidstts = 0
      and h.soptype = 2

  • Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc

    Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    When deploying a Crystal-enabled web app to a new server.

     I solved this, but it was a long road. I develop web apps that use crystal reports. For the most part they go on my servers, so I don't have to worry (and remember about) Crystal server deployment. This link is to another post in this blog that has my Crystal references. There is a link to a page there that has 'server deployments'.

     In my latest issue, I had deployed the most recent server deployment (Crystal XI r2 sp2) but that gave me fits. It got better when I installed the original deployment (which was current when the app was written - Crystal XI r2). I still had to change a few of the version numbers, but that was the big hurdle.

    http://vstoolsforum.com/blogs/crystal_reports/archive/2007/01/25/crystal-xi-release-2.aspx

More Posts Next page »