?
Solved

Printing a report in Visual Basic from an Array

Posted on 2003-03-04
6
Medium Priority
?
187 Views
Last Modified: 2013-11-25
I have a vb  program that reads a sql database for errors.  When it finds an error it writes to an array. (this works).   I want to write these errors out to a report but the only problem is that the number of errors is larger than one form page so they scroll off the page and I cannot see the other errors.  I need another solution to generate an error report to display to the user.  Can anyone help.

Thanks
0
Comment
Question by:running32
[X]
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
6 Comments
 
LVL 2

Accepted Solution

by:
JoaTex earned 200 total points
ID: 8068489
Hi
Try this litlle code and a correct it to your application:

Code:

Option Explicit
Dim MyArray(100)
Dim ContPrint
Dim N

Private Sub CommandPrint_Click()
   ContPrint = 1000
   For N = 0 To 100
      Printer.CurrentX = 1000
      Printer.CurrentY = ContPrint
      Printer.Print MyArray(N)
      ContPrint = ContPrint + 240
      If ContPrint >= 15000 Then
         Printer.NewPage
         ContPrint = 1000
      End If
   Next N
   Printer.EndDoc
End Sub

Private Sub Form_Load()
For N = 0 To 100
   MyArray(N) = N
Next N
End Sub
0
 
LVL 3

Expert Comment

by:DocM
ID: 8068513
Use a TextBox with the MultiLine property set to True
and the ScrollBars property set to 2.
0
 

Expert Comment

by:MRAMetharam
ID: 8069794
I agree with DocM. If you are only going to show this to the user why complicate your life :)

KISS
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:running32
ID: 8073027
JoaTex, What is I wanted to display it on a new screen as well as print it?

I am using a list box but it scrolls off the page.

Thanks
0
 

Expert Comment

by:CleanupPing
ID: 8900690
running32:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9046863
Moderator, my recommended disposition is:

    Accept JoaTex's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

771 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