Acess violation with Rich Edit

I am new to FR4 and I am using Delphi 2007 and Advantage Database tables
I want to display a memo field in RTF so I created a report that has the report header, a Group header, a MasterData Band and a Page footer

I drop a Rich Text Object on the MasterData band and set the dataset and the datafield to the memofield and save the report
I use a button click in my Delphi program to run the report.

procedure TClientForm.BitBtnPrintClick(Sender: TObject);
var
AliasPathRpt: string;
begin
AliasPathRPT := ExtractFilePath(Application.ExeName)+'db6adv\';
myreport.LoadFromFile(AliasPathRPT+ReportTableFilename.Value );
myreport.ShowReport();
end;

I run my program and the reports runs fine but when i close my program, I get an access violation.
"Access violation at address 00407AD6 in module 'BA6.exe' Read of address 01F15194" BA6.exe is my program

I run other reports using the above code but no Rich Edit object and they run fine. Also I noticed if I ran another report after running the one with the Rich Edit then I do not get the access violation.

Is there something I need to do after the report prints to stop the access violation.

Thanks for your help

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:43PM
    did you add the rtf object from the component palette to the underlying form.
  • edited September 2011
    gordk wrote: »
    did you add the rtf object from the component palette to the underlying form.
    I have tried adding the TfrxRichEdit to the uses on the form but I still got the access violation.
    I tried several things but it the report seems to run fine when the preview displays the report but i get the access violation when i close my program if that was the last report that I used. That is why I thought maybe I need to close something.
    I looked for an example that shows how to use the Rich Edit in an actual report and I even tried to write a program that only prints a report with the Rich Edit but no luck.
    I have looked a lot for a simple example that works but no luck.
    One other thing I am using the standard edition of FR4 but I have not purchased it. I am trying to see if it is easier to use than what I am using now.
    It says that the only difference between the purchased edition and the trial edition is the nag screens. I hope this has nothing to do with it.
    I have read the User manual documentation and the programmer and the developer manuals as well but no luck . I also searched this problem on the forum before posting and found nothing.
    Any help in the right direction would be appreciated.
  • gordkgordk St.Catherines On. Canada.
    edited 3:43PM
    compile and run the main demo look at the rtf report under addin objects.
  • I had already done that but i went back and played with it some more. In the demo the Rich Edit object is small and you can not see the entire text. This is part of what was throwing me off. The other part was when you double click on the Rich Edit object it opens the Rich Text Editor, once I saw what was going on with the data plus that you can added your own standard text then it started making more sense. I didn't see any documentation whatso ever telling me what I just learned. I haven't tried the final soultion yet but I am confident it will now work. I will try it ASAP.
    This has led me to one more question if you don't mind.
    When you click and save the RTF file some where what does that do. I changed the demo a little and notice that if I clicked on the check mark near the save icon it saves it automatically but I dont know as what or where or why.
    I really appreceiate you nudging me in the right direction. Thank you for your patience also.
  • gordkgordk St.Catherines On. Canada.
    edited 3:43PM
    when you click on the check mark that just saves the changes you made in the rtf object in the designer.
    when you click on the save to file button it is saved in the default save dir of the program or if you have included a designer component in your program what ever save dir you have set the designer to at runtime
    the rtf memoview works much like the memoview except it is rtf.
  • Thanks for the info. I created a program that only had one button and I loaded the code to load the report and show it. The report works fine in this program. Seems that the error in my original program has to do with when I add the TfrxRichObject component. Not sure why but my program seems to work fine until I add this component. ;0(

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.