change the title

edited 11:08AM in FreeReport
dear all,

i've just installed free report and stuck with this problem.

how to change the report title at run time. i want to use editbox.text as may report title.

please help me.

darmanto

Comments

  • edited 11:08AM
    Hope I'm not too late with this! Setting headings at runtime is basically simple, but I ran into a number of snags and the following is how I got mine to work.

    In freeReport create a variable (File/Variables and click on Variables...)
    Type a category aligned to left margin
    Next line type TWO spaces followed by your variable name (in my experience one space does not work!)
    eg

    Titles
    Title1var

    Click OK and OK again

    Double click your textbox and type "Title is [Title1Var]
    If you use the variable button it will insert [ Title1Var] which does not work unless you remove the extra space.

    Now in your Delphi code put

    frReport1.LoadFromFile('Filename.frf');
    frVariables := 'Your Title';
    frReport1.ShowReport;

    Good luck!
    Let me know if it works for you too.

    Ches
  • edited 11:08AM
    Title1Var had two spaces in front of it when I typed the above example variable declaration!

    Ches

Leave a Comment