Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Dynamic Formula Post Reply Post New Topic
Author Message
ongrpt
Newbie
Newbie
Avatar

Joined: 26 Jun 2012
Location: Malaysia
Online Status: Offline
Posts: 9
Quote ongrpt Replybullet Topic: Dynamic Formula
    Posted: 04 Jul 2012 at 6:23pm
Hi everyone, hope you can help.

How do I create dynamic formula for Record Selection.
Noting that within the formula there is a prompt id {?userId}

This prompt will appear based on user roles. There are cases that some users will not see this prompt.
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 05 Jul 2012 at 3:33am
You'll have to set a default value for your prompt.  Then in the Select Expert you'll edit the selection formula to include something like this:
 
({?userID} = "Default Value" or MyTable.UserID = {?userID})
 
Note the parentheses around this - if you have other selection criteria, you MUST include the parentheses in order for this to work correctly.
 
-Dell
IP IP Logged
ongrpt
Newbie
Newbie
Avatar

Joined: 26 Jun 2012
Location: Malaysia
Online Status: Offline
Posts: 9
Quote ongrpt Replybullet Posted: 05 Jul 2012 at 4:26pm
Thanks Dell,

We are actually trying to merge two reports right now, one for manager and the other for clerk. The only difference between the two is the number of prompts. Because of crystal's limitation we had to create two of the same report but with different prompt.

My objective is to merge these two and I am finding it impossible to do so in crystal report, mainly for two reasons. We are not able to determine the role of the users from CSC, and we don't know how to control which prompts to show either groups.

So we resorted to Business View and we are having loads of challenges there, namely prompts and formulas... have you faced anything like this to create/generate dynamic crystal reports based on user roles?

Thanks Dell
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 06 Jul 2012 at 2:43am
I haven't had to do this, and the different sets of parameters is a challenge.  You would probably be better off NOT merging the two as there is no way to control which parameters are visible and which aren't unless you're running the report through an application that you've written that handles all of the prompts and then passes them to the report internally rather than showing the Crystal prompt screen.
 
-Dell
IP IP Logged
ongrpt
Newbie
Newbie
Avatar

Joined: 26 Jun 2012
Location: Malaysia
Online Status: Offline
Posts: 9
Quote ongrpt Replybullet Posted: 16 Jul 2012 at 9:39pm
Thanks Dell, we actually tried Stored Procedures and Business View but could not come around to achieving the above :(
Thanks
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.