DA TfrxDATable and FastReport 6


(Claudio Piffer) #1

Hi,

how can I use the {where} parameter (or a custom server parameter) in a TfrxDATable inside a fr3 report? Have you some samples?

I use last official DA and FastReport 6.2.13 in Delphi 10.3 Rio


(marc hoffman) #3

Claudio,

my apologies for the delayed response here. Unfortunately my colleague Eugene, who knows best about this area, is out off office this holiday week. I’ll make sour ehe gets back to you with assistance, first thing next week.

thanx & Happy Holidays,

marc


(Claudio Piffer) #4

Hi Marc

no problem! Many thank for you support!

Happy Holidays to you and to all RemObjects Team!


(marc hoffman) #5

Thanx!


(EvgenyK) #6

TfrxDATable class has public Table property

    property Table: TDAMemDataTable read FTable;

not sure, can you have access to it inside report or not.


by other hand, you can add DynamicWhere property:

  TfrxDATable = class(TfrxCustomTable)
  private
...
    function GetDynamicWhere: String;
    procedure SetDynamicWhere(const Value: String);
...
  published
...
    property DynamicWhere: String read GetDynamicWhere write SetDynamicWhere;
  end;

...
function TfrxDATable.GetDynamicWhere: String;
begin
  if FTable.DynamicWhere.Expression = nil then
    Result := ''
  else
    Result := FTable.DynamicWhere.Xml;
end;

procedure TfrxDATable.SetDynamicWhere(const Value: String);
begin
  if Value <> '' then
    FTable.DynamicWhere.Xml := Value
  else
    FTable.DynamicWhere.Clear;
end;

some example of such DynamicWhere xml string:

  • price > 20 AND qty <= 5
<?xml version="1.0"?>
<query xmlns="http://www.remobjects.com/schemas/dataabstract/queries/5.0" version="5.0">
  <where>
    <binaryoperation operator="And">
      <binaryoperation operator="Greater">
        <field tablename="ORDER_DETAILS">price</field>
        <constant type="Byte" null="0">20</constant>
      </binaryoperation>
      <binaryoperation operator="LessOrEqual">
        <field tablename="ORDER_DETAILS">qty</field>
        <constant type="Byte" null="0">5</constant>
      </binaryoperation>
    </binaryoperation>
  </where>
</query>
  • LastName = ‘Frank’
<?xml version="1.0"?>
<query xmlns="http://www.remobjects.com/schemas/dataabstract/queries/5.0" version="5.0">
  <where>
    <binaryoperation operator="Equal">
      <field tablename="SALESMEN">LastName</field>
      <constant type="WideString" null="0">Frank</constant>
    </binaryoperation>
  </where>
</query>

(Claudio Piffer) #7

Many thank’s EvgenyK

I will try and let you know

Best regards