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
Solved

Adjust Paper width and printer option in VB6 DataReport

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

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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