Temporary sort a child table for reportbuilder export purposes destroys master-child link

Hi,

This does not work, our code is mostly DA3 based on TDACDSDataTable.
TDAMemDataTable does not allow such a source

[dcc32 Error] dm_LijstRapportService.pas(1053): E2010 Incompatible types: ‘TDAMemDataTable’ and ‘TDADataTable’

Hi,

try to replace TDACDSDataTable with TDAMemDataTable on client-side

There are many layers of class inheritance that forms a generic layer for our legacy DA3 tables
It is not possible to change this for a particular table.
If I change this I change it for about 1000 DA tables.
I fear it will break code (both at compile time and at runtime).

Hi,

try to copy CDS table to mem table with TDADataTable.CopyRecordSet

Hi,
In this mode I get the same error as with my own dataset copy routine
Which is that it does not print the calculated field

I have attached 3 generated reports
OverzichtProductenNoClone.xls = Not cloned with correct ‘Stock’ column but bad content
OverzichtProductenCopyRecordSetCalcFalse.xls=using CopyRecordSet(Tabel,False,False);
OverzichtProductenCopyRecordSetCalcTrue.xls=using CopyRecordSet(Tabel,False,True);

The last 2 have correct content but the ‘Stock’ column which is calculated shows data from another dataset (some header data)
Can we do a CopyRecordSet where the calculated fields behave exactly the same as the original?
or even better: Can we do a CopyRecordSet where the calculated fields get converted to regular fields which would give us the possibility to sort on the calculated field in the DA table?

ExportExcelIssue.zip (6.0 KB)

Hi,

you can do it easily by hand:

  • copy table struct, set Calculated :=False for all fields in new table
  • perform something like
  aSource.First;
  while not aSource.Eof do begin
    Dest.Append;
    for i := 0 to k-1 do
      Dest.Fields[li1[i]].Value := aSource.Fields[li[i]].Value;
    Dest.Post;
    aSource.Next;
  end;

FYI: I have tried this but it does not solve my issue.
The column still has the wrong value just like OverzichtProductenCopyRecordSetCalcTrue.xls

FYI: It would seem he associates the field with a different dataset
The content ‘Apotheker Rudy Fictief’ is some content of a field of another dataset

Hi,

for lookup field, you can use lookup field in result datatable.

can you create a simple testcase w/o DevEx and ReportBuilder that reproduces issues with copying datatables?
in ideal, it could be 2 TDBGrid that linked to original and copied datatable
I’ll review and fix errors if they would be present.

you can send it to support@ for keeping privacy.