Solved

Creating a PDF file in a VB application

Posted on 2002-07-17
12
320 Views
Last Modified: 2010-05-02
Hi,
I am working with a VB project.In this project I am generating a report (a text file with .txt extension) for more than 1000 clients per day.The VB application automatically generate the report getting input from SQL sever data base and e-mail to the respective client.It is working fine.

Now I want to generate a .pdf file in place of the text file.Is it possible  a VB application to automatically generate a pdf format report by getting values from the data base and with out any user intervention.

Thanks
shaji

0
Comment
Question by:shaji_am
[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
12 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 7158981
There are a number of ways you could achieve this, however they all require some sort of PDF writer to achieve it. You can either use the Acrobat (full version not just the reader) application to create PDF files, there is a PDF writer printer driver that can be used or you can use the Acrobat Distiller application which can take .ps (postscript formatted) files and convert them automatically to PDF. Personally I use Distiller, I simply print to a postscript printer driver sent to a file in a folder watched by the distiller process and the .pdf file is output to another specified folder.
0
 

Author Comment

by:shaji_am
ID: 7159011
Hi Tim,
Thank you for the reply.If it is possible , then my company will  purchase the software.My aim is a fully automated system. ie, generate the pdf report file and e-mail it to the clients.I am new to this environment.Can you please give me some more specification about the programming, some helpful texts, web sites etc.
Thanks
Shaji
0
 
LVL 4

Expert Comment

by:gencross
ID: 7159206
There is also a reporting tool called ActiveReports that I use to do reporting.  It will export the report in PDF, RTF, or XLS format.  Very quick and easy to use.  You could use it to generate the report as opposed to the txt file then make one call to export the report to a PDF.  I have plenty of code to create a dynamic report and export if you would like to see it.  Check out this web site... www.datadynamics.com
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:jeet
ID: 7167481
Like Tim, I have installed Acrobat (full version about $200), so i just "print" to the Acrobat printer from my VB app. Acrobat's API allows for the filename of the pdf to be set from the vb app, so no user intervention is required.

Jeet
0
 

Author Comment

by:shaji_am
ID: 7355052
Hi,
If I install Acrobat full version , is it possible to generate PDF in Japanese or Chinese fonts. or a combination of some different fonts.
Thanks
0
 
LVL 4

Expert Comment

by:gencross
ID: 7355766
Yes, I believe Acrobat will generate a pdf that matches the document that you send to it.  As far as I know it doesn't matter what font or language is used in the document.
0
 

Author Comment

by:shaji_am
ID: 7358506
Hi,
I have some more doubts.
Which function I need to use for writing to the PDF.Is it the PRINT function of VB?
How can I set the page size(width & height) and othere charecteristics like font size,boldness etc.
Is it also from VB?
Thanks
0
 
LVL 4

Accepted Solution

by:
gencross earned 250 total points
ID: 7360184
Use the printer object in VB

Printer.Print
Printer.FontSize = 12
Printer.FontName = "Arial"
Printer.FontBold = True
etc...
0
 

Author Comment

by:shaji_am
ID: 7417853
Hi,
I have installed adobe full version and set the distiller as the default printer.Now I am able to create the pDF file and no issue with japanese font.In the report Japanese and English fonts are comming together. I am able to get some portion BOLD even. Now I am facing some other problems.
1. During the application run , the windows dialog box is activating and asking for a file name.ie, I am failed to put the file name in the program.

2. I am not sure about how I can dynamically pass different file names at runtime .(The file names are actually generated by the application)

3. How can I put a page break . In my application I have different sections and I want some of the sections should start in a new page.

4. Can I control the number of lines to be printed in one page from my application.Also page width , page height, orientation etc.

Thanks
0
 

Author Comment

by:shaji_am
ID: 7432991
Hi ,

Any solution??
Thanks
0
 

Author Comment

by:shaji_am
ID: 7451948

How can I add a Report object to my appliction.
Thanks
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8013751
Hi shaji_am,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: TimCottee and gencross

shaji_am, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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