Solved

Multiple copies of a report based on a summary field

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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