Solved

Adjust Paper width and printer option in VB6 DataReport

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

770 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