Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Assigning lines in TQuickReport


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Feb 3, 2016 3:23 AM Last Post By: Lajos Juhasz Threads: [ Previous | Next ]
John Warren

Posts: 19
Registered: 9/19/10
Assigning lines in TQuickReport  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 1, 2016 5:37 AM
Hi,

Is there any difference between the following expressions in TQuickReport?
What is the implication of using one over the other?

QRExprMemo1.Lines.Add('This is an example '+FloatToStr(Form1.NumberValue));

QRMemo1.Lines.Add('This is an example '+FloatToStr(Form1.NumberValue));

Many thanks in advance!

Regards,
John

Edited by: John Warren on Feb 1, 2016 3:07 PM

Linden ROTH

Posts: 467
Registered: 11/3/11
Re: Assigning lines in TQuickReport  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 1, 2016 3:17 PM   in response to: John Warren in response to: John Warren
John Warren wrote:
Is there any difference between the following expressions in TQuickReport?
What is the implication of using one over the other?

QRExprMemo1.Lines.Add('This is an example '+FloatToStr(Form1.NumberValue));

QRMemo1.Lines.Add('This is an example '+FloatToStr(Form1.NumberValue));

Regards,
John


The difference is that you are using either a TQRMemo or a TQRExprMemo ... so use the one you need

ie TQRExprMemo. A composite of TQRExpr and TQRMemo. You can use this to include {braced} expressions in multi-line blocks. This makes it an absolute natural for doing addresses, especially since it includes a boolean property RemoveBlankLines.

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
John Warren

Posts: 19
Registered: 9/19/10
Re: Assigning lines in TQuickReport  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 3, 2016 2:32 AM   in response to: Linden ROTH in response to: Linden ROTH
Linden ROTH wrote:
The difference is that you are using either a TQRMemo or a TQRExprMemo ... so use the one you need

ie TQRExprMemo. A composite of TQRExpr and TQRMemo. You can use this to include {braced} expressions in multi-line blocks. This makes it an absolute natural for doing addresses, especially since it includes a boolean property RemoveBlankLines.

--
Linden

Hi Linden,

The situation at hand, is that we are not using a DataSet. As such, there is no ‘Table’ in the report object to iterate through all the records in its DataSet.

In this very critical situation; we have, say, a product value ‘FloatToStr(Form1.NumberValue)’ from the main form.
Then, how can I use this {braced} expressions in multi-line blocks?

At least:
QRExprMemo1.Lines.Add('This is an example {FloatToStr(Form1.NumberValue)} );
or
QRExprMemo1.Lines.Add('This is an example {Form1.NumberValue} );

is not displaying any value for ‘Form1.NumberValue’

Any help and enlightenment will be highly appreciated. Thanks!

Regards,
John
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Assigning lines in TQuickReport  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 3, 2016 3:23 AM   in response to: John Warren in response to: John Warren
John Warren wrote:

Linden ROTH wrote:
The difference is that you are using either a TQRMemo or a
TQRExprMemo ... so use the one you need

ie TQRExprMemo. A composite of TQRExpr and TQRMemo. You can use
this to include {braced} expressions in multi-line blocks. This
makes it an absolute natural for doing addresses, especially since
it includes a boolean property RemoveBlankLines.

--
Linden

Hi Linden,

The situation at hand, is that we are not using a DataSet. As such,
there is no ‘Table’ in the report object to iterate through all the
records in its DataSet.

In this very critical situation; we have, say, a product value
‘FloatToStr(Form1.NumberValue)’ from the main form. Then, how can I
use this {braced} expressions in multi-line blocks?

At least:
QRExprMemo1.Lines.Add('This is an example
{FloatToStr(Form1.NumberValue)} ); or
QRExprMemo1.Lines.Add('This is an example {Form1.NumberValue} );

is not displaying any value for ‘Form1.NumberValue’

Any help and enlightenment will be highly appreciated. Thanks!

Regards,
John

The correct code is:

  QRExprMemo1.Lines.Add('This is an example
'+FloatToStr(Form1.NumberValue))
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02