Search code examples
delphiquickreports

Quickreport property PreviewLeft does not exists


I have a program, which uses quickreports 5 to generate some reports. The program has always been compiled on one specific PC. Now i want to develop the program on other machines, i have a big problem with the quickreports.

Although i installed the same version of quickreports (5.0.2) on the new machines, i cant get the program to work on them. As soon as i open a form with a quickreport on the new machines, i get the error:

Error reading FrmMyReport.PreviewLeft: Property PreviewLeft does not exist. ...

I can compile the program, but as soon as i use a form with a quickreport on it, i get this exception:

Project MyProject.exe raised exception class EReadError with message 'Property PreviewLeft does not exist'.

When i do a break here it stops in TCustomQuickRep.Create. After debugging it seems to happen in TCustomQuickRep.SetBandValues at the Line if assigned(FPage) and assigned(FBandList) and.

I also tried manual installation of the packages, with compile - install, added all possible directories to the library paths. Nothing works. I can't see a difference between the old machine, where it works fine, and the new ones.

I hope someone can help me to fix this problem. It's really important to be able to develop this application on new machines. Thanks for any help.


Solution

  • Are you positive that the old and the new machine do have the same version of QuickReport installed? Because the error message usually happens when you have component's description in DFM created with newer version than the one youre using, ie

    • version x of the component introduces new property PreviewLeft;
    • you're developing with version x, the property is saved into the DFM;
    • you compile / open the project with component version x-1 which doesn't have the property and streaming system raises exception as it can't find the property in the old version of the component.

    It is also possible that the new version drops an (obsolete) property but in that case component vendor usually takes care to silently ignore the property during streaming so no exception is raised. So I suspect that you have actually an older version of the QuickReport installed in th new machine. I don't use QuickReport myself so I don't know when the PreviewLeft property was introduced and what for it is needed... if it is left coordinate for the preview window, then I'd say it is harmless to ignore it and clean it up from DFMs - the hard way is to open the reports one by one in IDE and press "Ignore" in error dlg, the easy way is to use some tool, ie I believe Jedi might have such a tool.

    UPDATE The Jedi tool is called DFMcleaner, it is in jvcl\devtools\DFMCleaner directory in my Delphi 5 installation.