Reportbuilder report sorting error

Asked

Viewed 156 times

0

In a report built in Delphi7 Reportbuilder I have vendor information in a group header and vendor items in a Detail tab just below. The problem is that it is not possible to sort items (Detail) according to parameter ('C' code or’D' description)

More information:

The report data comes from a precedent and the ordering is done directly in the Dataset of the report object in Delphi. That is, I have a precedent that mounts all the sql where the data is pulled that will be displayed while in the IDE the Dataset component has in its sql code the order by that should order the header in alphabetical order and the items according to the parameter.

ex: with code 'C' sorting parameter, i.e., items sorted by code

FORNECEDOR A
item 1 "B"
item 2 "A"
item 3 "C"

FORNECEDOR B
item 1 "B"
item 2 "A"
  • If I change the parameter to’D' the result remains the same when expected:

    SUPPLIER TO item 2 "A" item 1 "B" item 3 "C"

    SUPPLIER B item 2 "A" item 1 "B"

in the dataset, obviously gets:

    select (dados) from procedure as alias 
order by (campo do titulo do fornecedor, 
case par_ordenacao
 when 'C' codigo when 'D' 
descrição end

1 answer

0

Try it that way:

case
    when par_ordenacao = 'C' then codigo
    when par_ordenacao = 'D' then descricao end asc
  • Unfortunately here it was not possible to execute the report by adding the "asc". I cannot say for sure what it was. At first what you said seems to be a possibility. Error: SQLDA Missing or incorrect version, or incorrect number/types of variables

  • Using which version of sql?

  • Note: The problem occurs even if I choose "Description" (’D') to sort the item.

  • Yes yes, of course if we make one work the other will work accordingly. Your sql is the same ansi?

  • About the version of Sql, at first here I use Ibexpert 2014. Note 2: I also tested for the "asc" before but it presents error as well

  • And removing it, since asc is the standard..

  • Yes, but if we remove the asc then we go back to square one, because then the code is as it was before.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.