Solved

Multiple copies of a report based on a summary field

Posted on 2004-09-01
7
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month5 days, 5 hours left to enroll

636 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