Solved

Multiple copies of a report based on a summary field

Posted on 2004-09-01
7
147 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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