• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 553
  • Last Modified:

Random Alphanumeric String in Crystal Reports

I have a report that provides a list of people and some of their details.  I want to include a password on the report that provides a randomly generated string of 6 alphanumeric characters to be used as a password.  I want each user's "password" to be different.  

Is there a formula or such that I can place into Crystal (version 11) to generate a 6 character alphanumeric string for each record?  If so, how?

Thanks!
0
ajholmes
Asked:
ajholmes
  • 3
  • 3
  • 2
1 Solution
 
mlmccCommented:
There is nothing built into Crystal.

Crystal doesn't have a random number generator but if you can build a VB application that generates the random 6 character string you could use it as a UFL in Crystal and call it from a formula

mlmcc
0
 
crgary_txCommented:
what database you are using? Every database should have some random generator functions. For in Oracle you can use something like this:
select <the colomns used in report>,  dbms_random.string('A', 20) str
from yourtable

where 20 is the length of the string
A->alphanumeric both uppercase and lower case
U->upper case

google for different databases..
L->lower case
0
 
ajholmesAuthor Commented:
The database is Oracle.

I am somewhat new to Crystal and was wondering where can I see the actual Select statement to try the dbms_random.string('A', 20) str  method?
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
crgary_txCommented:
What are you using as datasource?

Tables/view/Stored procedure? Go to database->set datasource location to find this information

If you are using view or stored procedure or a command object, simply include the above function in the select statement..

Gary
0
 
mlmccCommented:
As far as I know you would have to build the query in the database to use that function.

mlmcc
0
 
ajholmesAuthor Commented:
I am using both a table and view for the report.  I guess I am not sure where in Crystal I can see the actual SQL statement in its entirety.
0
 
crgary_txCommented:
Can you add this function in the select statement of the view script in the database?
You cannot add it in the sql query shown by crystal. If you want to just see the sql query you can go to database->'Show SQL Query'.
However you have to use the function in a query on the d/b side as suggested by mlmcc
0
 
ajholmesAuthor Commented:
Got it!  The dbms_random.string('A', 20) str  worked!

Thank you!!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now