Solved

Adjust Paper width and printer option in VB6 DataReport

Posted on 2009-06-30
5
1,612 Views
Last Modified: 2013-11-26
How can I change the page width of the DataReport and also make it print directly to the printer instead of the screen first?

At this point we have problem that we can' increase the width to print it Landscape and keeps giving me error:

---------------------------
Error
---------------------------
Report width is larger than the paper width
---------------------------
OK  
---------------------------
0
Comment
Question by:rayluvs
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
3_S earned 500 total points
ID: 24756645
To print directly instead of display on screen
do not use datareport.show
but

datareport.PrintReport
While datareport.AsyncCount > 0
      DoEvents
Wend

The loop with the doevents must be added else if you print other reports directly after, you will get missing pages. (some pages will not be printed) So add the loop directly after the printreport.

To avoid you report width error, try setting the printer you want to use as default printer before calling the report.
0
 

Author Comment

by:rayluvs
ID: 24756699
ok

What about the Page Width?
0
 
LVL 10

Assisted Solution

by:3_S
3_S earned 500 total points
ID: 24756993
Check your service pack of VB
http://support.microsoft.com/kb/261193 or http://support.microsoft.com/kb/253555 for additional info
latest sp can be downloaded from microsoft filename : Vs6sp6B.exe
0
 

Author Comment

by:rayluvs
ID: 24762724
I have the lates SP6.

Thanx "DataReport1.Orientation = rptOrientLandscape" worked.

Is that the only option for width, just the orientation?  

I mean what if I need to print to a receipt printer which is 4", that is 40 column.  Is there a way to work with that?
0
 

Author Comment

by:rayluvs
ID: 24766489
I'll close this question

Thanx
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

743 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