Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Generate Range Values Post Reply Post New Topic
Author Message
PPCrystalLogin
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 6
Quote PPCrystalLogin Replybullet Topic: Generate Range Values
     Posted: 10 May 2013 at 8:16am

Hello,

I have been struggling with this for a while now, but I need a way to generate barcode labels in Crystal Reports.  Here's out it works, when the report is run, two parameters are asked for, a lower bound value and an upper bound value.  So, if for example, a user types in a lower bound value of 1 and and upper bound value of 100, the report will generate barcodes with labels from 1 to 100.  I accomplished this by using a command object and creating a field with a temporary SQL table that appends the values until the upper bound is reached and with my SQL field I simply place it within the details section of my barcode report.  The problem here is that common users need to view this report, and some might now have elevated privleages to perform the task of creating a temporary SQL table -- not only that but it requires a connection to a database everytime it is run.

I initially was trying to use arrays in a formula field to spit out the results, but CR XI (which is what I am using) has that annoying feature not being able to return array values.  So as you can see I am currently forced to use the SQL option.

Don't get me wrong, the SQL option is a neat trick in itself, but I'd prefer to keep away from a database when all this report is doing is generating range values to be displayed in a details section of a barcode report.

Any help will GREATLY be appreciated.  Thanks.

 

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 May 2013 at 10:43am
a 'standard' answer is to have a source of numbers, the first answer I saw for this suggested an excel spread sheet. Then you just ask for the all the numbers less than x. I have never done it this way, but it is one way to accomplish this.

Another would be to have a 'number' table in your database, and then select all values less than what you are looking for...but it would require the connection to the database.

Hope one of these help.
IP IP Logged
PPCrystalLogin
Newbie
Newbie
Avatar

Joined: 09 May 2013
Online Status: Offline
Posts: 6
Quote PPCrystalLogin Replybullet Posted: 10 May 2013 at 11:11am
Thanks for the reply.  Believe or not I delved into the solutions you described.  After I realized I couldn't use an array in the formula field, I built a table in my database to house all possible combinations of sequences (to make it even larger the range values can accept alphanumeric characters).  This was just as good as my temporary table, but that mean reserving space in my db for this table when in reality it doesn't have to.  The excel idea is good, but then again it comes down to keeping it somewhere on the network so not only the app the app the report can have access to it, but the viewers as well.  What it comes down to is pick your poison.

Anyway, thanks for the reply.
IP IP Logged
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