Solved

Adjust Paper width and printer option in VB6 DataReport

Posted on 2009-06-30
5
1,806 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

685 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