New old topic, Class not found
So on to my problem. I'm creating the report in code (yes, our users don't want to see the report designer hell)... for example adding a Master Data to the report from code.
var
MasterData : TfrxMasterData;
MemoView : TfrxMemoView;
ds : TfrxUserDataSet;
begin
MasterData := TfrxMasterData.Create(APage);
MasterData.CreateUniqueName;
ds := TfrxUserDataSet.Create(MasterData);
ds.CreateUniqueName;
ds.RangeEnd := reCount;
ds.RangeEndCount := 10;
ds.OnGetValue := UserDataSetGetValue;
MasterData.DataSet := ds;
When I preview the report I get:
ERROR : Project raised exception class EClassNotFound with message 'Class TfrxUserDataSet not found'.
Yes, yes, I do have a TfrxUserDataSet component on the form that 'hosts' the tfrxReport. frxClass is in the uses clause. Getting rather frustrated with it....
HELP, HELP, HELP, HELP, HELP, PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!
Comments
Delphi XE
The form unit that has the "frxReport" and "frxPreviedw" uses clause:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
cxPCdxBarPopupMenu, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, ExtCtrls, cxPC, Printers,
Spin, ReportDesigner, ReportCommon, frxPreview, dxSkinsCore, dxSkinBlueprint, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle,
dxSkinHighContrast, dxSkinSevenClassic, dxSkinSharpPlus, dxSkinTheAsphaltWorld, dxSkinVS2010, dxSkinWhiteprint, dxSkinscxPCPainter,
frxClass, frxBDEComponents, frxExportPDF, Mask, frxDBSet, frxADOComponents, frxDBXComponents;
the frxReport is passed through to another unit that adds the code shown in my fist post.
=============================
Could this be a problem with the FastReport packages, installation? Has anyone tried the recompile option for FastReport? I really need to move forward with this...
Thanks
Yep, this product is dead in the water isn't it?
Thanks but this doesn't work either. At this stage I think I'll try to reinstall the FastReport controls. If that doesn't work then there are thankfully other reporting tools that I can use...
I've tried copying the 'uses' clause into my project but have the problem still. To reiterate the problem isn't during compilation but when I call the method to add the masterdetail with userdata to the report.
I noticed that if I included, for example, frxClass to the 'uses' clause of my project right clicking on it and selecting 'Find Declaration' didn't take me to the unit. After running the Fast Report Recompile utility this now works.
Unfortunately I still have the 'Class TfrxUserDataSet not found' error when I try to create a TfrxMasterData with a TfrxUserDataSet to the report...
Getting nowhere fast!
SOLUTION:
After stepping through the code for a bit I've found that for some reason the FastReport code was failing at a FindClass() call, looking for TfrxUserDataSet.
So all you have to do is add a RegisterClass(TfrxUserDataSet); to the create() of the application to solve the problem.
Thanks
[img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> P.S. Fast Report guy(s). You could support a bit more even when the problem is more Delphi/user than FastReport. Though why the UserDataSet isn't registered is beyond me.... anyway, onwards!!![/img]
I had something similar occur (on runtime cannot load TfrxUserDataSet)
my issue was the type of TComponent I was registering as the owner of the new components on run time
My mistake was
TfrxUserDataSet *userSet = new TfrxUserDataSet(TfrxReport);
The report cannot initialize ownership of the TfrxUserDataSet. However changing it to the form that can initialize ownership of the TComponent works
TfrxUserDataSet *userSet = new TfrxUserDataSet(TDataModule/TForm);