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

Crystal Reports

Notes, Tips and Tricks on Developing using Crystal Reports
  • 'CrystalReportViewer' is ambiguous in the namespace 'CrystalDecisions.Web'

    Also:

    Error 13 'ReportDocument' is ambiguous in the namespace 'CrystalDecisions.CrystalReports.Engine'. C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb 11 18 C:\...\Culinart\

    Error 15 'DiskFileDestinationOptions' is ambiguous in the namespace 'CrystalDecisions.Shared'. C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb 47 26 C:\...\Culinart\

    Error 16 'ExportDestinationType' is ambiguous in the namespace 'CrystalDecisions.Shared'. C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb 50 57 C:\...\Culinart\

    Error 17 'ExportFormatType' is ambiguous in the namespace 'CrystalDecisions.Shared'. C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb 51 52 C:\...\Culinart\

    I solved this by going to Project Propertities > References, somehow I had references to two different versions of crystal in my project. While doing this I noticed that the references kept coming back. I searched the project and found that I had double lines iin the web config to different versions of Crystal.

     

  • 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

More Posts Next page »