EClassNotFound with message "Class TfrxReport Not Found"

Hello guys,

I am reposting this issue, since I am still unable to find a solution to the problem around the "Class TfrxReport Not Found" exception.

"Class TfrxReport not found" is being thrown when I include to my report-generating project additional Units whose source code does not reside in the same directory as my the source code of my Report-Generating project.

To be more clear, assume that my report-generating project, together with its main form "Unit_ReportingToolMForm", is stored in:

c:\delphi_projects\Reporting_Tool\

folder.

Assume I have a Unit, which I have written long time ago, that parses xmll, and that I want to reuse this functionality without duplicating code. Now assume that this piece of old source code, let us call it "Unit_XMLParser.pas" , lies in a shared_libraries folder on my c drive:

C:\shared_libraries\Unit_XMLParser.pas

where I store all my helper files. Besides that, assume "Unit_XMLParser.pas" uses other units from the same shared_libraries directory and is being used by other projects, so moving or copying it into c:\delphi_projects\Reporting_Tool\ would not solve the problem.

So, I add the Unit_XMLParser in the project source code like this:

uses
...
Unit_XMLParser in 'Unit_XMLParser.pas',
...

and I add the "C:\Shared_Libraries\" folder to the search path via: Project->Options->Compiler-> Search Path.

lastly I add the "Unit_XMLParser" in the uses clause of my Unit_ReportingToolMForm.

Then I compile, Build and run the program, when I wish to generate a report by clicking on a Build Report button on my main form I get "TfrxReport class not found" over and over again.

As you suggested, I checked the options-> library -> Library Path settings and I confirmed that the path to Fast Reports is correctly set.

C:\Program Files\FastReports\FastReport 4\LibD16
.

The funny thing is that I generate the Report without any problems when I remove the additional Unit_XMLParser unit from my project and use only my main unit and other units that reside in the same directory 'c:\delphi_projects\Reporting_Tool\ ' and do not reference or reuse any of my "shared_library" units.

I tried all suggested solutions:

i) Add RegisterClass(TfrxReport); somewhere on program's startup.
ii) Check the RAD Studio Libraries path settings
iii) downloading the http://www.fast-report.com/pbc_download/LibD16.zip file and replacing the corresponding dcu's

Nothing seems to work. I cannot discern whether or not the problem is in fast reports as a tool, or I am doing something fundamentally wrong. Any hint in any direction will be much appreciated.

Thanks a lot for your help

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 9:42AM
    Kenny
    this is just a guess
    Unit_XMLParser in 'Unit_XMLParser.pas'
    this appears to be an entry in the dpr file it should probably be just
    xmlparser added to the uses clause of a form.
    the other possibility is that your pas files in the shared lib may reference old locations for versions of fr which have been removed.
    try just adding a copy of the xmlparser.pas into your current project folder
    and uses clause of your Unit_ReportingToolMForm
  • gordkgordk St.Catherines On. Canada.
    edited 9:42AM
    Kenny disregard my last post.
    Can you compile and run frs main demo?
  • edited 9:42AM
    gordk wrote: »
    Kenny disregard my last post.
    Can you compile and run frs main demo?

    Hi gordk,

    unfortunately I had to leave town for a while and I do not have the source code where I am right now. I will compile the demo and write back to you first thing next week. Thank you for the support!
  • edited 9:42AM
    gordk wrote: »
    Kenny
    this is just a guess
    Unit_XMLParser in 'Unit_XMLParser.pas'
    this appears to be an entry in the dpr file it should probably be just
    xmlparser added to the uses clause of a form.
    the other possibility is that your pas files in the shared lib may reference old locations for versions of fr which have been removed.
    try just adding a copy of the xmlparser.pas into your current project folder
    and uses clause of your Unit_ReportingToolMForm
    None of the files in my "shared_libraries" folder uses fr. First time I use this library is in my Reporting tool applicaiton.
    Thanks for the suggestion.
  • edited 9:42AM
    gordk wrote: »
    Kenny disregard my last post.
    Can you compile and run frs main demo?

    Compiled! However it complained a little bit in the begining, while loading the project, that it could not find the TfrxDesigner, TfrxDialogControls and TfrxCrossObject component's installed.
    However after removing the declarations, the main demo runs and behaves in a more or less stable way.

    Thanks. I will try to find a way around this problem and If I manage to fix it, I will post the solution and detailed bug description here.
  • edited February 2013
    [SOLVED] Guys, good news. I managed to solve the problem!!

    I simply updated RAD Studio XE2 (including Fast Reports as Third Party component) and everything worked as it should. Maybe the problem was that I was using a self compiled ( from a seperate download) version of Fast reports rather than the one that is distributed with the XE2.

    Thanks for the advice to everyone.

    Regards
  • gordkgordk St.Catherines On. Canada.
    edited 9:42AM
    Just remember that the version supplied with xe is a limited version you have no scripting inside the report.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.