Home DADE
New Blog Posts: Merging Reports - Part 1 and Part 2

daADS.pas

edited February 2008 in DADE
I am working with Delphi 5 and Advantage database.
When I have an expression of the type "field1 + ',' + field2" (where
field1 and field2 are strings fields), the result is: "value1
,value2 (notices the spaces between value1 and ',').
I tried to add the line "FTable.AdsTableOptions.AdsPreserveSpaces :=
False;" in function TdaADSDataSet.GetTable and the line
"FQuery.AdsTableOptions.AdsPreserveSpaces := False;" in constructor
TdaADSQueryDataView.Create in daADS.pas file, but it did not work.

Any ideas?

Lucas J. Colombo

Comments

  • edited February 2008
    Hi Lucas,

    I do not believe this option will affect the issue you are experiencing.

    From the Advantage Help....

    AdsTableOptions.AdsPreserveSpaces

    Boolean flag used to specify if you want character fields set as empty
    strings
    to be written as a buffer of spaces instead of converted to a NULL/empty
    value. Default value is False.

    Are you certain your initial field does not contain the spaces that are
    added at the end? Are you able to get a correct output if you access the
    dataset directly without using ReportBuilder?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2008
    Hi Nico,
    I certain my initial field not contain then spaces at the end. If I use
    a Variable component with the following Calculation "Value :=
    xxx['fieldname1'] + ', ' + xxx['fieldname2']" do not have this problem.
    If I use a field calculated with the expression "fieldname1 + ', ' +
    fieldname2" the spaces are added at the end of every field.
    I looking for this problem in Advantage Help and could repeat the
    problem in an application of test using the API function "AdsGetString
    (ADSHANDLE hTable,UNSIGNED8 *pucFldName,UNSIGNED8 *pucBuf,
    UNSIGNED32 *pulLen,UNSIGNED16 usOption);". If the parameter usOption
    is ADS_NONE then spaces add at the end up to completing the length of
    the field. With the "AdsGetField" API function the same result is obtained.


    Nico Cizik (Digital Metaphors) escribió:
  • edited February 2008
    The datapipeline uses the TField.AsString routine to get the value from a
    TDataSet descendent. If there is an option to trim the spaces off a field
    in ADS, you would need to set it for the FQuery property of the
    TdaADSQueryDataView class.

    You might try contacting Advantage support for help with setting this option
    if available.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.