Solved

Printing an access database

Posted on 1999-01-12
3
486 Views
Last Modified: 2013-11-26
I would like to print an access database. I already can print the text in a tabel, but I would like all the lines and boxes, so it is easy to read the tabel. Please help

my email is kasper_germann@hotmail.com
0
Comment
Question by:kgermann
3 Comments
 
LVL 5

Expert Comment

by:chewhoung
Comment Utility
I assume that you are using VB. You can just create a simple report in Crystal report (you can give border to the field) and print it.
0
 
LVL 14

Expert Comment

by:waty
Comment Utility
You could try the PrintPreview OCX :
http://www.geocities.com/ResearchTriangle/6311/prview50.zip

/*
|*  Print Preview ocx 3.5.11 by Thierry Waty
\*

Description
-----------

PrintPreview is an OCX which enables you to add print preview
capabilities to your Visual Basic applications in VB 5.0 and VB 6.0
and all the development tools wich accepts the ocx technology
like Visual Basic, Visual C++, Office, Delphi, PowerBuilder...


Target platforms
----------------

For 32-bit Visual Basic 5.0, Visual Basic 6.0 Visual C++, Office, Delphi,
Powerbuilder, decompress PRVIEW50.ZIP.

You need Microsoft® Visual Basic® 5.0 Service Pack 3 or higher in order to
run properly. If you need a version without any service pack, it is possible,
you have to contact me in that case.
                         
See also the zip files for the Print Preview OLE Control for
VB 3.0, 4.0 (16 bits and 32 bits)

For 16-bit Visual Basic 3.0/4.0 development, decompress PRVIEW16.ZIP.
For 32-bit Visual Basic 4.0 development, decompress PRVIEW32.ZIP.

You can also use it in a VB 3.0 environment (you still need all
the DLL for VB4) as following :
     > Set Preview = CreateObject("PrintPreview.clsPreview")


What is an ActiveX control
--------------------------

An ActiveX control is an extension to the Visual Basic Toolbox.
You use ActiveX controls just as you would any of the standard
built-in controls, such as the CheckBox control. When you add an ActiveX
control to a program, it becomes part of the development and run-time
environment and provides new functionality for your application.
ActiveX controls leverage your capabilities as a Visual Basic programmer
by retaining some familiar properties, events, and methods, such as
the Name property, which behave as you would expect. Then, however,
the ActiveX controls feature methods and properties that greatly increase
your flexibility and capability as a Visual Basic programmer.
For example, the Visual Basic Professional and Enterprise editions include
the Windows Common controls that allow you to create applications
with the look and feel of Windows 95 toolbars, status bars, and tree views
of directory structures.
Other controls allow you to create applications that take full advantage
of the Internet.


Archive contents
----------------

The archive file contents the following files :
  File                  Description
*******************************************************************************
- File_Id.diz   Description of the Zip file
- Readme.txt    This text file
- Order.txt     The order file
- Preview.xls      Sample of Excel 95 file using Print Preview
- Preview.oft      Sample of Outlook using Print Preview
- Preview.mdb      Sample of Access 95 using Print Preview
- Licence.txt   The licence explanation
- API.txt       List of all API & parameters of the Preview Object
- API.htm       List of all API & parameters of the Preview Object in html
- API.rtf       List of all API & parameters of the Preview Object in RTF
- Preview.ocx   The OCX
- Preview.hlp   The help file
- Test.exe      The EXE file for the sample
- Test.vbp      A sample test program
- Main.frm      The main form for the test program
- Main.bas      Basic module containing constants and Preview Object
- Preview.bmp   The BMP for the preview file
- Preview.h     H file containg the constants for C developments
- ActiveX.txt   A complete explanation of ActiveX
- UserTxt.txt   All the user text in all language
- Banner.gif      Banner of my website if you want to add it to your website


Intent
------

With the PrintPreview OCX, you can replace your printer object in
all your code with this object. You will be able to :
    - You can preview your printed text on the screen
    - You can have many pages as you want
    - You can zoom/unzoom the pages (like in the Word)
    - You can preview two pages at one time
    - You can print the text
    - You can save the text in a structured file
    - You can reload saved printed text
    - You can save the text in an ASCII format
    - You can have the interface in multiple language
    - When you double clik on the page number,
      you can go directly to a specified page
    - You can search strings in all previewed pages
    - Load, preview and print bitmaps at any position
    - Make report based on data provided by you through APIs
    - You can use the Print Preview in Spanish
    - You can use the Print Preview in German
    - Toolbar with bitmap if desired
    - Possibility to use styles to format the text
    - Automatic alignment to left, center, right
    - Help file added
    - You can use Print Preview in Office (Excel, Outlook, Access...)
    - You can create a report based on a database and a query
    - New graphics possibilities : CheckBox, RadioButton
    - Word Wrap capabilities for long lines
    - Works with Chinese, Arab... character set
    - You can use the Print Preview in Dutch
    - You can use the Print Preview in Italian
    - New improved interface with some new features
    - You can set the zoom directly in your application
    - You can now setup all the user interface to interact with your user
    - You can save output to bitmap
    - You can add text with any angle you want
    - Win98 Interface with gradient title bar
    - You can configure all the user text in the Print Preview
    - You can see all the API in HTML format
    - You can preview Grid, DBGrid
    - The Print Preview looks like Internet Explorer 4
    - You can use the Print Preview in Danish
    - ... Many other features
      
The use of this ocx is very simple.


            J U S T   T R Y   I T.


Future
------

- Many other possibilities for the report generator
      -> Add preview of msflexgrid, listbox...
      -> Add preview of PrintForm
      -> Add better sorting
      -> Add of subtotals and general totals
      -> Add possibility to read/save RTF files
      -> ...
- Translation of the interface in other language (Chinese,...)


Feedback / Register
-------------------

When you register, the very nice about box displayed each time you start
disapear, and you can print more than one page.

Tell me what you like, what you don't like, and for that matter, if you think
the tool is worth a $20 shareware fee.
If you're feeling particularly generous, and would like to send
the registration fee, you may send money, payable in US funds,
or your in local currency to the following address:

-----   Waty Thierry
-----   Rue de l'agriculture, 56
-----   1030 Brussels
-----   Belgium

E-Mail   : mailto:waty.thierry@usa.net
Web Site : http://www.geocities.com/ResearchTriangle/6311/

If you are using Credit Card, you can do the registration online on
the Internet at http://www.shareit.com/programs/101728.htm
But in that case, you have to add 10$, for the fee of the company handling
this service. The price comes to 30$. The support and help provided
by myself is the same.


System Requirements
-------------------
You need a computer running Microsoft® Windows 95/98® or Microsoft® Windows NT®.
Microsoft® Visual Basic® 5.0 (Service Pack 3) or Higher.


Installation
------------

For the sample program, just load it in your Visual Basic 5.0, and update
the reference to use the Print Preview OCX.

As with all OLE Controls you must register Preview.OCX before it can
be used.  The setup program will register the control for you.
However, if you move an OCX control, you must re-register the control
in its new location.  You can do this with the Project menu in VB 5.
Select the Components... menu item and then press the Browse... button
to locate and register the control.

ActiveX controls have the file name extension .ocx.
To add your Print Preview ocx in your Visual Basic 5.0 project, you add
it to the Toolbox..
      
->>>>> To add a control to a project’s Toolbox
1      On the Project menu, click Components to display the
      Components dialog box (Tip : You can also display the dialog box
      by right-clicking on the Toolbox.
      
2      Items listed in this dialog box include all registered insertable
      objects, designers, and ActiveX controls.

3      To add the Print Preview control to the Toolbox, click the Browse
      button, and locate the file "Preview.ocx".
      When you add The Print Preview control to the list of available
      controls, Visual Basic automatically selects its check box in
      the Components dialog box.

4      Click OK to close the Components dialog box. The Print Preview ocx
      will now appear in the Toolbox.


Problems
--------

You need to install the Service Pack 3 of VB5 in order to run correctly
this version. If you don't have installed SVP3, I can compile for you
a version without any Service Pack, or consider installing the
Service Pack 3 of Microsoft. It is free. you can find it on the web
site of Microsoft.

If you have problems during the installation or the execution of
the Print Preview, this is probably due to the fact that you didn't
have installed all the DLL from your VB 5.0

Try install all the DLL (including the DAO). If the problem still
exists, contact me and I will solve the problem with you.


Conclusion
----------

Thank you for taking the time to download PrintPreview.
I hope you find it to be of use in your development efforts.
Please let me know how it can be made better!


License
-------
This product is licensed to you pursuant to the terms of the license
agreement included with the original software, and is protected
by copyright law and international treaties.  
Unauthorized reproduction or distribution may result in severe civil
and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.


Other products
--------------

I have also developped other products. They are all on my web site.
Here is the list of them :
      - VBIDEUtils add-ins for VB 5.0, 6.0
        - Print Preview OCX for VB 5.0, VC++, VB 4.0 32 bits, Office...
        - Print Preview OLE 2 Control for VB 3.0, VB 4.0 16 bits
        - TBCalendar OCX for VB 5.0, VC++, VB 4.0 32 bits, Office...
        - Logger OCX for VB 5.0, VC++, VB 4.0 32 bits, Office...
        - INIEditor : Editor of INI files
        - Jolly OCX 1.0 card game for VB 5.0, VC++, VB 4.0 32 bits, Office...
        - Rotate label OCX 1.0 for VB 5.0, VC++, VB 4.0 32 bits, Office...


History
-------

*Version       *Date             *Comments
******************************************************************************
*Version 1.0b  *05 July 1996     * First beta release
*Version 1.1b  *08 July 1996     * Bug fix, Tooltips, Printer setup
*              *                 *  going directly to a page, export to a
*              *                 *  text file, import of a text file
*Version 1.1   *10 July 1996     * First release
*Version 1.2   *11 July 1996     * Bug fix when no printer defined corrected
*              *                 * Description of the API added
*Version 1.3   *07 August 1996   * Fix for 640x480 resolution
*Version 1.4   *08 August 1996   * Improved speed for more than one page
*              *                 * Use of much less memory
*              *                 * Bug fix when saving to structured file
*              *                 * Bug fix in the sample
*Version 2.0   *21 January 1997  * Fixed bugs when saving to structured file
*              *                 * Fixed APIs for using from VB 3.0
*              *                 * Added APIs to support other languages
*              *                 *  - English, French
*              *                 * Added possibility to choose Paperbin
*              *                 *  from the code
*              *                 * Added API to load from structured files
*              *                 *  and append it to an existing document
*Version 2.1   *26 January 1997  * Added the possibility to zoom like in Word
*              *                 * Some minor improvments
*              *                 * Fixed bugs when orientation in landscape
*              *                 * Fixed bugs when saving to structured file
*              *                 *  from the printer panel
*              *                 * Added the possibility to view two pages
*              *                 *  at one time
*              *                 * Added properties 'Height' and 'Width'
*              *                 * Added properties 'TwipsPerPixelX'
*              *                 *  and 'TwipsPerPixelY'
*              *                 * Added methods 'TextHeightPreview'
*              *                 *  and 'TextWidthtPreview'
*Version 2.2   *30 January 1997  * Added property CurrentPage
*              *                 * Fixed a bug when printing
*              *                 * Getting configuration from printer
*Version 2.3   *12 February 1997 * Fixed bug with printer
*              *                 * Added method Count to see how many items
*              *                 *  in the PrintPreview object
*Version 2.4   *15 February 1997 * Fixed bug with printer
*Version 2.5   *15 March 1997    * Fixed minor bugs
*              *                 * Added a find possibility
*              *                 *  Use CTRL+F and F3 key to search
*              *                 *  It writes in red the text found
*              *                 * Added a parameter to the method EndDocument
*Version 2.6   *18 April 1997    * Fixed minor bugs
*              *                 * Added possibility to load bitmaps
*              *                 *  The method is PreviewBMP
*Version 2.7   *30 April 1997    * Some little bugs fixed when printing
*Version 2.8   *13 Mai 1997      * Added possibility to print bitmaps
*              *                 * Added web site
*              *                 * Changed my post adress
*Version 3.0   *01 August 1997   * First release of the Print Preview ocx
*              *                 * Improvments of the interface....
*              *                 * Add the load and print of
*              *                 *  bitmap (.bmp) files, icon (.ico) files,
*              *                 *  run-length encoded (.rle) files,
*              *                 *  metafile (.wmf) files,
*              *                 *  enhanced metafiles (.emf),
*              *                 *  GIF files, and JPEG (.jpg) files
*              *                 * Added possibilities to generate report
*              *                 *  directly based on data you give to the
*              *                 *  report generator.
*Version 3.01  *06 August 1997   * Added the translation in Spanish
*              *                 * Fixed a minor bug win the find routine
*              *                 * Added the API PrintNumberPage
*Version 3.02  *08 August 1997   * Added the translation in German
*Version 3.03  *01 October 1997  * Added a property to show/hide the print
*              *                 *  button : ShowHidePrintButton
*              *                 * Added the possibility to print directly
*              *                 *  with showing the Print dialog
*Version 3.1   *17 October 1997  * Added a new toolbar with bitmap
*              *                 * Enhancment for the zoom
*              *                 * Corrected some bugs
*              *                 * Better HTML export
*              *                 * Added the possibility to use/define styles
*              *                 * Added the possibility to align text
*              *                 *  to left, center and right of the sheet
*              *                 * Added the complete help file
*Version 3.2   *25 October 1997  * Fixed some bugs when using Print Preview
*              *                 *  within Excel and Outlook
*              *                 * Added the possibility to generate reports
*              *                 *  directly using a database and a query
*              *                 *  It prints all the fields with all data
*Version 3.2.1 *30 October 1997  * Fixed a bug with the API LoadText
*              *                 * Added a parameter to DrawCheckBox :
*              *                 *  It allows now to draw a cross in the
*              *                 *  checkbox to indicates the status
*              *                 * Added API DrawRadio checked/unchecked
*Version 3.2.2 *06 November 1997 * Added Word Wrap property
*Version 3.2.3 *06 January 1998  * Bug fixed when printing bitmaps
*Version 3.3.0 *12 January 1998  * Bug fixed with flashing scroll bar
*              *                 * Added the API SetLanguageDutch
*              *                 *  to have all the interface in Dutch
*              *                 * Added the file Preview.h containing
*              *                 *  the constants for C developments
*Version 3.3.1 *27 January 1998  * Added the API SetLanguageItalian
*              *                 * Some bugs fixed in the interface
*Version 3.4.0 *18 February 1998 * Added Status bar to the interface
*              *                 * Added three buttons to fit/zoom page
*              *                 * Added API Version
*              *                 * Fixed a bug with the margins on some printers
*Version 3.4.1 *01 March 1998    * Bug fixed with some printers
*              *                 * Added API to know the margins of the printer
*Version 3.4.2 *11 April 1998    * Added Property to giving the total number
*              *                 *  of pages
*Version 3.4.3 *27 Mai 1998      * Corrected a minor bug
*Version 3.4.4 *30 June 1998     * Added the possibility to set directly
*              *                 *  the zoom factor in your application
*Version 3.4.5 *09 July 1998     * Added the possibility to set if you want
*              *                 *  the box for the header in the report
*              *                 * Added the possibility to set if you want
*              *                 *  the column name in the box of the header
*              *                 *  or under the line in the report
*Version 3.5.0 *06 August 1998   * Added the possibility to set the color
*              *                 *  background of the text
*              *                 * Added the possibility to rotate text
*              *                 * Added possibility to save to bitmaps
*              *                 * Corrected bugs in the reports
*              *                 * Corrected some minor bugs in the save file
*Version 3.5.1 *11 August 1998   * Added the gradient title bar
*              *                 * Added some enhancments in the user look
*              *                 * Added a new documentation of APIs
*Version 3.5.2 *13 August 1998   * Added the possibility to set all
*              *                 *  the user text of the interface
*Version 3.5.3 *08 September 1998* Choose between gradient titlebar or not
*              *                 * Best implementation of save as HTML
*Version 3.5.4 *02 October 1998  * Better Error handling
*Version 3.5.5 *09 October 1998  * Added preview of grid and DBGrid
*Version 3.5.6 *19 October 1998  * Corrected order in the Report_Query
*              *                 * Added a property to set the number of
*              *                 *  print copies
*              *                 * Added the possibility to set the caption
*              *                 *  of the Print Preview window
*              *                 * Now, disabling some buttons will hide them
*Version 3.5.7 *28 October 1998  * Corrected order in the Print Range
*              *                 * Added the possibility to set the FontSize
*              *                 *  for reports
*              *                 * Added the property to allow the PrintPreview
*              *                 *  to work as non-modal
*Version 3.5.8 *11 November 1998 * In the registered version, the Registered
*              *                 *  bitmap is no longer visible
*              *                 * Added a property to show or hide the icon
*              *                 *  in the left corner of the statusbar
*              *                 * Added a property to enabled/disable the
*              *                 *  possibility to zoom/unzoom using the mouse
*              *                 * Added a property to set the toolbar as
*              *                 *  in Internet Explorer 4
*              *                 * Added a property : PrintQuality to set
*              *                 *  the printer quality of the output
*              *                 * Added a property : ColorMode
*              *                 *  to set if you want to print in color or
*              *                 *  monochrome on color printer
*              *                 * Added a property : DeviceName
*              *                 *  to indicates the name of the current
*              *                 *  printer device
*              *                 * Added a property : Port
*              *                 *  to indicates the port used of the current
*              *                 *  printer device
*              *                 * Added better error support when no printer
*              *                 *  defined
*              *                 * Corrected some bugs when no printers were
*              *                 *  were declared in your windows
*              *                 * Added the Print Preview icon in the taskbar
*              *                 *  when the Preview window is minimized.
*Version 3.5.9 *19 November 1998 * Added a new helpfile
*Version 3.5.10*01 December 1998 * Added the possibility to set the font
*              *                 *  for the LoadTextFile API
*Version 3.5.11*12 January 1999  * Added the API SetLanguageDanish
*              *                 * Corrected a little bug when printing
*              *                 *
*******************************************************************************


Notes
-----

Visual Basic, Windows, Windows NT, Windows 95, Windows 98, and Windows 3.11
are all registered trademarks of Microsoft Corporation.


                        \\\\|////
                        ( O   O )
                   ---oOOo--U--oOOo---
       Have you ever danced with the devil by the pale moonlight!!!

0
 
LVL 1

Accepted Solution

by:
yfang earned 50 total points
Comment Utility
The easy way:  export the table to Mxcel and then print it.
The hard way (not too hard): create a crystal report.
Good luck.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

762 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

6 Experts available now in Live!

Get 1:1 Help Now