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

AutoSearchFields and Fieldalias

edited March 2004 in General
I got a report with two autosearchfields. I set the value of the field in my
delphi app with a for loop. I compare the FieldName property because I have
to know which value I have to take. Workes fine. The fields are RECIPEID and
RECIPERELEASE and are stored in the table called REZ.
Now I got a special report. It's using a other datasource; it's not the REZ
table! The table is JNL and the RECIPEID and RECIPERELEASE are stored in
other fields called SATTR1(ID) and NATTR1(RELEASE).
Back to the delphi app: In my for loop I check if the FieldName = RECIPEID
or RECIPERELEASE and fill it with the right value. In the special case the
field names are SATTR1 and NATTR1. What now? I can't add a if command to
check if the FieldName = SATTR1 ... because the RECIPEID is not always in
SATTR1, it can be a other field!
Now what I tryed is to give the field SATTR1 the alias RECIPEID and I added
a extra if statement in my for loop. I even check if the FieldAlias =
RECIPEID. So far so good. But now the report does not work anymore. On
previewing the report can't find a field. I guess it means RECIPEID.
Consequential, RECIPEID does not exists in JNL. It seems report builder
takes the FieldAlias to get the data from database. I was thinking it is
just a 'Alias'. How can I fix that problem? Anyone having an idea?
I hope you understand my problem. I've used my best english attainments;)

--

Mit freundlichen Gr??en
Sven Langenkamp

Tel.: +49 (0) 50 21 / 97 24 -15
Email: langenkamp@ctdatentechnik.de

===============================
CT Datentechnik Gesellschaft
f?r Prozessrechentechnik mbH
Eschenstr. 2 - 31582 Nienburg
Tel.: +49 (0) 50 21 / 97 24 -0
Fax: +49 (0) 50 21 / 97 24 -18
Email: info@ctdatentechnik.de
Internet: www.ctdatentechnik.de
===============================

Comments

  • edited March 2004
    Hi Ace,

    My suggestion would be to use the DataPipeline.Fields[] property to access
    these fields in your database. You can use the Fields Editor on the
    DBPipeline to define the names of the fields you would like to use, then
    access these names inside the report. This way when you switch to a new
    table/datapipeline, you can still check the same names without having to
    access the datasource directly at all.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    Thanks, but it workes now. We made a database view. In this view SATTR1 is
    called RECIPEID :D


This discussion has been closed.