Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiple copies of a report based on a summary field

Posted on 2004-09-01
7
Medium Priority
?
159 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 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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

722 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