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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sequential Ticket Numbers

Status
Not open for further replies.

RoknRole

Programmer
Feb 2, 2005
36
0
0
US
Hi everyone! I am using Crystal Reports 10 hitting an Oracle database containing information about events such as event_ID, date, time, and location. The customer wants to print tickets for the events. The report will have a string parameter {?EventID}, which will return one row of data containing date, time, etc. The report will also have two number parameters – {?StartTicketNbr} and {?EndTicketNbr}. No ticket numbers are stored in the database. The idea is to print numbered tickets for each event. For example, the first ticket would print out something like the following:

EVENT ID: B0100005
DATE: April 5, 2007
LOCATION: Crystal Mist Ballroom
TICKET NBR: 1001

The number 1001 would represent the value of the {?StartTicketNbr} parameter.

The second page, or perhaps the second column if they want to print more than one ticket on a piece of paper, would be:

EVENT ID: B0100005
DATE: April 5, 2007
LOCATION: Crystal Mist Ballroom
TICKET NBR: 1002

Subsequent pages/columns would print sequentially up to the value of the {?EndTicketNbr} parameter.

I thought this would be relatively easy, but haven’t found a way so far to do it. Thanks in advance for any ideas!
 
You have to have more than one record in the report in order to get the event values to repeat. Because you also need to generate the ticket number, I think you should just create a table in Excel or Access that contains all possible ticket numbers from 1 to however many, using the fill function to fill the cells. Then use this new {table.ticketno} as your main report field, and restrict it with your start and end parameters. Insert an unlinked subreport in a detail_a section for the first three lines of the event info, and limit the subreport records by using the Event parameter. Add a formula for the fourth line in the main report and place it in detail_b:

"Ticket Number: "+totext({table.ticketno},0,"")

If you want to, you can then go to the section expert->details->format with multiple columns->layout->set the width and gap, and check down then across.

-LB
 
Thanks lbass for your idea. I had thought of that, since I used a similar technique in the past to display rows with no data in a Length Frequency Distribution cross-tab report. I ended up using a formula in the Report Header to create the sequence of numbers, and another formula in the Details section to overlay the numbers over the "background" of the report contained in the Page Header. The only limitation is that strings can only have a maximum of 65,535 character, but that't not a problem since only blocks of 100 tickets are printed at a time. It's working great and will save thousands in printing costs. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top