Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reindex a report programaticaly
Message
From
17/04/2003 10:58:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/04/2003 10:50:03
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
00778856
Message ID:
00778862
Views:
17
>Hello *.*
>
>
>I need to change the order of my report bypassing parameters, can I do it?
>I have a Customer Report that I need to show it ordering by Name and by City, my user will decide wich order he wants.
>
>Tanks in advance

In my programs, I use something similar to the following (more complicated, but I am omitting details which are irrelevant for the explanation):
local lnSortOrder, lcOrderClause
lnSortOrder = ThisForm.CboSortBy.Value && ComboBox on form
do case
case lnSortOrder = 1 && By Name
  lcOrderClause = "order by ClientName"
case lnSortOrder = 2 && By City
  lcOrderClause = "order by City, ClientName"
case lnSortOrder = 3 && By creation date
  lcOrderClause = ""
endcase

select * from Client &lcOrderClause into cursor Temp

report form ClientList ...
It is important that the report have nothing in its DataEnvironment.

Note that with macro substitution, you could also easily create a SELECT command with a variable WHERE condition.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform