Solved

Multiple copies of a report based on a summary field

Posted on 2004-09-01
7
152 Views
Last Modified: 2013-12-25
Looking for a VB code to use in Crystal Reports 8.5 that will print multiple copies of a same report (pick ticket), based on a summed field, (total cube). For example, if [totalcube] is <=2800, 1 pick ticket prints - [totalcube] <=5600, 2 print - [totalcube]  <=8400, 3 print - [totalcube] <=11200, 4 print - etc         Thanks                                            
0
Comment
Question by:bella459
  • 2
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
Z03niE earned 500 total points
ID: 11960450
After reading your question for a while, I think I begin to understand what you are up to now. Well... I guess I'm kinda a slow thinker. Let's see.... what's the option.
I'll try giving a solution where you will print automatically from VB, even without viewing the report(ticket).If you want another solution we'll try to find some. Here goes :

      Dim I as integer        'I will be the number of tickets you want to print
      dim CrxReport As CRAXDRT.Report  
      if [totalcube]  <=2800 then I = 1
      elseif  [totalcube]  >2800 and [totalcube] <=5600 then I = 2
      ......
      ......
      ...... ' and so on
     
      ' then you delcare the open report stuff..... (I assume you already got the code)
      ' after that put this single but most important line :
      CrxReport.PrintOut False, I               ' this will print the same report as many as I false = without promting, use true if you want to prompt printer select and number of copy stuff
       'If the report contain more than 1 pages, say 2 use
       CrxReport.PrintOut False, I, , 1, 2      'just learn the function for more options.

Hope that help...
If you got any other question, just ask.
0
 

Author Comment

by:bella459
ID: 11962636
Thanks for providing some feedback Z03niE. Can you explain or provide the code to declare the "open report stuff"? My report I'm trying to work this out on is called "sowfba4.rpt". (what do you expect from a network guy)?  Thanks again, bella459
0
 
LVL 5

Expert Comment

by:Z03niE
ID: 11969903
Give me a break Mike.......
You may see some example from Crystal report on VB codes to open report.
Does your report use static data? I mean the content doens't change based on some data from a database ?
Maybe you would liket to see this link.

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_21051452.html

I got some report opening stuff with recordset as datasource in that link. Try learning something from the link. If there's something that you don't understand, just ask me. OK
Thnx.
0
 

Author Comment

by:bella459
ID: 11971035
Thanks again...No the report does not use static data. Data comes from a few ODBC tables. I'll check out the llink you provided above though.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now