Aggregate function at runtime

Hi, i'm trying to set an aggregate function in c++ builder xe5 code, i'm doing this:

memo = dynamic_cast<TfrxMemoView *> (frxReport1->FindObject("Memo5"));
memo->Text = "[Sum(<Group.\"Total\">, MasterData1, 1)]";

Memo5 is on a GroupFooter band, but when I run the app and try to generate the report it shows the next message:

Access violation at address 00FB3D34 in module 'fs19.bpl'. Read of address 00000000

I'm using Fast Report 4 Embarcadero Version (the one that comes with XE5 version) and generating a sql query using FireDAC

any suggestion?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:52AM
    I assume you are doing this after loading the report and before running it
    i am not a c programmer but try using
    memo->memo->Text = "[Sum(<Group.\"Total\">, MasterData1, 1)]"
    if that fails try using a call to designreport temporarilly to see what is placed in the memoview
    you may have some string delimiters stripped
  • edited 1:52AM
    Hello
    I have the same problem ,have you find a solution please ???
  • gordkgordk St.Catherines On. Canada.
    edited February 2017
    Did you try my suggestion to troubleshoot?
    Where are you writing this code ?
    another tip place the value you are trying to enter by code
    in the memo and see if the report runs as expected.
    if it does then you are probably missing string delimiters or you are
    writing the code in the wrong place
    you must do it when the report is first loaded NOT in the onbeforeprint event

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.