Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a Group Condition

Status
Not open for further replies.

fitz3

Programmer
Apr 29, 2002
2
US
I have the user pick, through ASP, if they want to print the reports daily,monthly, or yearly. In a formula field, I want to find out what they have chosen. Is there a parameter in CR, that I could pull in a formula field, that tells me if the group is by day, month, week, etc.?

for example, I want to do this:

If group condition = "weekly" then
<code>
if group condition = &quot;monthly&quot; then
<code>
etc.

thanks
James
 
fitz3,

One way to achieve this is to write a formula that uses the parameter the grouping choices reside in, like the example code you gave, but then in your report - group by this formula. Example:

If {?group} = &quot;R&quot; then
{customer.customer_region}
else if {?group} = &quot;C&quot; then
{customer.customer_country}
else
{customer.customer_city}

hope this helps

paulmarr@arcom.com.au
 
On the web page, I have an option for the users to group it by day, week, quarter or month. In asp, I use this code to tell the report:

Select Case Request.Item(&quot;cboDateGroup&quot;)
Case &quot;Day&quot;
session(&quot;oRpt&quot;).Areas.Item(&quot;GH&quot;).GroupCondition = 0
Case &quot;Week&quot;
session(&quot;oRpt&quot;).Areas.Item(&quot;GH&quot;).GroupCondition = 1
Case &quot;Month&quot;
session(&quot;oRpt&quot;).Areas.Item(&quot;GH&quot;).GroupCondition = 4
Case &quot;Quarter&quot;
session(&quot;oRpt&quot;).Areas.Item(&quot;GH&quot;).GroupCondition = 5
End Select

I need to know how, in the report, to find out what the user chose.

James
 
There is no way to get that property from the report. But you have it easy because you already HAVE the choice in ASP. All you need to do is pass the word (Daily, weekly, etc) to an empty formula field or string parameter field in the report. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top