Crystal Reports Error in Formula Record_Selection

This was a REALLY difficult problem to track down so I am adding it into the world for google to help someone else (or even myself again).

I used one cyrstal report as a basis for another. So I literally copied the report files to a new folder.

When running the report an error was thrown that I could not debug:

Error in File C:\DOCUME~1\Julie\LOCALS~1\Temp\temp_8c3aef3e-caf3-4214-99ee-6ff344a4c8a7.rpt:

Error in formula <Record_Selection>.

‘{MDTTests.fieldreportid} = {?Pm-FieldReportswithProject.fieldreportid}

This field name is not known.

What is strange about this error is that the namespace MDTTests is from the original report. So I knew that it was left over somewhere in this report. It took me over an  hour to find it. Now it seems obvious and easy to find, I don’t know what took me so long to try this

Once in here, I could see the offending code that just needed to be deleted. This is related to linking a sub report but does not show up in the dialog for linking a sub report and it does not get cleared on it’s own for some reason. In fact you can see that each time I went to fiddle with this setting through the link sub-report dialog, it just kept adding to the list.

I removed all but the last of these lines and my report came up perfectly.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

12 thoughts on “Crystal Reports Error in Formula Record_Selection

  1. I’m running through the same problem here, only it is not related to a subreport or anything, it’s just a normal report, when I open it in the report preview tool within visual studio, it runs perfectly, but during runtime, the error is issued. Any ideas?

  2. Oh, I wouldn’t know even where to begin. Sorry. Have you tried the Crystal reports forums? If you can’t find a scenario that matches yours, add a new question. Feel free to come back here and add a link to the thread so anyone else who finds this blog post can get some additional info. Here’s the forum link. forums.sdn.sap.com/…/forum.jspa the prompt for a certificate.julie

  3. Thanks for the pointers. Though my architecture is different, your pointers helped me in figuring out the issue.

  4. ank4.Open "SELECT purchase.material,(sum(purchase.qty)+balance.openingbal)-sum(purchase.sqty) FROM purchase purchase,balance balance Where purchase.material = balance.materialname GROUP BY purchase.material,balance.openingbal", con, adOpenDynamic, adLockOptimistic

    CrystalReport3.Database.SetDataSource ank4

    """""""""""""""

    i wnt second column in crystal report 9

    pl help me

    thanks in adv.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.