Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Report Design
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Report Design
Topic: Dynamic grouping by parameters
Author
Message
karthikkjm
Newbie
Joined: 19 May 2011
Online Status: Offline
Posts: 21
Topic: Dynamic grouping by parameters
Posted: 09 Jan 2012 at 5:22pm
in the report data source, i have one datatable, it contains the columns like
Invoice No, invoice Date, customer name, amount
.
in this report user can select the report grouping by invoice date orĀ by customer name. when i am creating a formula like this,
if(?GroupSelection) = 'Customer' then
{Invoice.Customer}
else if(?GroupSelection) = 'Date' then
{Invoice.Date}
it shows exception like,
"expecting string"
... because
{Invoice.Date}
is a column of DateTime, but
{Invoice.Customer}
is a column of string type.
Please help me how to create a single report with dynamic grouping...
Thanks in advance.
karthik
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 10 Jan 2012 at 6:38am
if(?GroupSelection) = 'Customer' then
{Invoice.Customer}
else if(?GroupSelection) = 'Date' then
totext({Invoice.Date},"yyyy-MM-dd")
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 10 Jan 2012 at 6:40am
this won't help you with the sorting on a string that was a date. Removes the option of grouping by different by date type options.
IP Logged
karthikkjm
Newbie
Joined: 19 May 2011
Online Status: Offline
Posts: 21
Posted: 10 Jan 2012 at 8:11pm
thank you.
is any way to handle this ?
karthik
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 11 Jan 2012 at 4:01am
one way is to create 2 formulas
//Group1
if(?GroupSelection) = 'Customer' then {Invoice.Customer} else "n/a"
//GRoup2
if(?GroupSelection) = 'Date' then {Invoice.Date} else Date(0,0,0)
Group first on @group1
Group second on @group2
Conditionally suppress each group header based on the param value
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.