VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 306,832 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,747 people online right now. Registration is fast and FREE... Join Now!




Data report

 

Data report, how to make second page if conditiion was satisfied

fernan

18 May, 2009 - 11:36 AM
Post #1

New D.I.C Head
*

Joined: 18 May, 2009
Posts: 2

Hello to everyone.. I am using Visual Basic 6.0 and was crating a data report. Here is the situation,

I have to provide a truck waybill and print it using data report.
the data the I need to see in the report is ready in the form "Creating Comercial Invoice" where my data report gets the details in the "Truck waybill" data report.

Now, My Invoice form displays the qty ordered and if the Qty ordered is greater than 2 trucks then I need to print the Truck way bill in two pages showing in each page one truck.

I already have the report but it shows 2 trucks and will probably print 1 page only of truck waybill stating 2 trucks instead of one.

any help will be much appriciated.

Fernan smile.gif

User is offlineProfile CardPM
+Quote Post


June7

RE: Data Report

18 May, 2009 - 10:50 PM
Post #2

D.I.C Regular
Group Icon

Joined: 9 Dec, 2008
Posts: 485



Thanked: 38 times
My Contributions
Am not familiar with reporting in VB6, just Access. In Access you can set grouping and sort records, with new page for next group. In your case, the trucks would each be a group. Anything like that in VB6 report?

This post has been edited by June7: 18 May, 2009 - 10:50 PM
User is offlineProfile CardPM
+Quote Post

fernan

RE: Data Report

19 May, 2009 - 12:18 PM
Post #3

New D.I.C Head
*

Joined: 18 May, 2009
Posts: 2

QUOTE(June7 @ 18 May, 2009 - 10:50 PM) *

Am not familiar with reporting in VB6, just Access. In Access you can set grouping and sort records, with new page for next group. In your case, the trucks would each be a group. Anything like that in VB6 report?



Hi..thanks for the reply.. well thats what I am trying to find out since this is my first time using data report in vb6.
if the qty ordered is more than 24.74 MT then Ill be needing to have another page to print the second truck waybill. it should be detected automatically by the program.

It could be like this. when the qty ordered = 49.5 then.. the data report should should print twice carrying 24.74MT each because the truck can only load 24.75 MT.

Fernan
User is offlineProfile CardPM
+Quote Post

June7

RE: Data Report

19 May, 2009 - 03:39 PM
Post #4

D.I.C Regular
Group Icon

Joined: 9 Dec, 2008
Posts: 485



Thanked: 38 times
My Contributions
Is the invoice one report object and the waybill another? If so, print the invoice then determine in code how many prints of waybill needed, something like:
CODE
intPages = int(qty / 24.75) + iif(qty mod 24.75 = 0, 0, 1)
For i = 1 to intPages
  'code to print waybill
Next
If the invoice and waybill are one report object, then should be able to use code to reprint only page 2.

This post has been edited by June7: 19 May, 2009 - 04:02 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/20/09 10:46PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month