Document generation - design approach needed

Started by John Montenigro, February 07, 2014, 03:20:08 PM

Previous topic - Next topic

John Montenigro

Here's a task that I've never even come close to having to do:

Using PBWin and FireFly (and if necessary, SQLTools Pro), I need to generate a business "form letter" that will:
1. go to different companies (therefore different names and addresses, etc.).
2. display the sender's letterhead and logo.
3. display different product information, obtained from a lookup table.

The text of the letter will require some formatting (tabbed indents, various fonts and font sizes).

I intend to build the program in FireFly, and have two forms:
- one for the user to enter the values for the required fields
- one for display of the "Print Preview" of the letter before: saving, printing, and/or emailing. 

Given these requirements, I am asking for help to determine the best strategy.

I know how to do the data lookups, and I think I know how to print/email the finished document, but I'm not sure about which controls to use in FireFly that would make all of this manageable...

- What's the best way to do a "Print Preview" in FireFly?
- Should the Preview form contain Rich Text control? How would I insert the logo file into RTF control?
- Instead, should I use a Graphic Window?
- Are there other tools or APIs or COM objects that I should be using?
- What's the best way to save the completed document? Any RTF formats? (I could print to CutePDF...)

I'm open to any and all ideas, thoughts, suggestions.

Thanks!
-John


David Kenny

John,

Why wouldn't that be done in something that is built for it, like MS Word?  It has mail merge, print preview, can handle the logo's, has its own document format... etc. Just doesn't seem to need custom program with the criteria you mentioned.
Do you have more criteria?

David

Israel Vega Alvarez

For print preview I am using DDOC and is working fine...and you can insert image into document.

http://www.greatwebdivide.com/software.htm

Also you can print to a html file and display with any browser or use code of Jose Roca with PDF using HARU
http://www.jose.it-berater.org/smfforum/index.php?topic=4710.msg18372#msg18372

Israel

Paul Squires

Gary Beene has a print preview on the PB site that is very good.
Paul Squires
PlanetSquires Software

Paul Squires

Just noticed that you posted in the gbPrintPreview thread.
Paul Squires
PlanetSquires Software

John Montenigro

Paul,
Yes, I'm looking at all options...
I didn't want to go too far on the PB website, but I did want to ask you about the DLL version of Gary's Print Preview: I don't know how to create the DLL from the code in his .zip file; all I saw was the .INC and the .BAS for a demo... AND, how would I incorporate it into my FF program? (I hate to admit it, but I have never created a DLL. My programs are small utilities, and I have no experience with DLLs...)

David,
I'm open to learning how to do that in MS Word. Years ago, I wrote some extensive macros for similar things, but I don't know how to achieve that through PB. Could you point me to some code that I could study? I'm happy to learn new techniques.
But for this project, I cannot rely on MS Word; I have to provide a self-contained program.

Israel,
Thanks for the links - I'll study and experiment over the weekend.

Thanks for the feedback!
-John


James Klutho

#6
Attached is an old version of gbPrintPreview (3.44) that I used as a starting point to the printing engine of MLG.  Gary has the code set up to make the print preview into a DLL.  I will warn you up front that DDT has a bad leak in making the toolbar imagelist out of ICONs and a few other leaks also, which if the DLL is called repeatedly tends to add up.  Should be straight forward making the DLL.  I am sure Gary wouldn't mind me posting his files here because it is released to the public domain. 

José Roca

You know what I do i my CSED editor? I build the pages using HTML and then I display them in the print preview of the Browser Control.

No problems about working in some printers and not in others, it is localized, etc.

David Kenny

Yea, I meant doing the whole thing in Word (or some other word processor for that matter).  I didn't mean controlling Word with PB. :P
So, an important criterion is that it must be a "self-contained program".

Knuth Konrad

A reporting component I use, which has a free "Community Edition" so that you can try it out, is Virtual Print Engine.

Paul Squires

I used to use VPE way back in my VisualBasic days! Loved it.
Paul Squires
PlanetSquires Software

John Montenigro

Thanks for all the suggestions! They are now on my ToDo List, and I will tackle them one at a time in due course...

Meanwhile over the weekend, I experimented at length, but seem to have missed something...

I can XPRINT ATTACH to a printer, and all my text comes out as it should, but I just cannot seem to get a PREVIEW to work.

In frmMain, there's a Preview button, in which I set up the XPRINT statements, and there's a frmPreview on which I've tried a variety of controls, trying to find one that will display the preview.

I think I'm doing something wrong with the ATTACH statement. So here's what I'm doing in frmMain:

      XPrint Attach Default       
      'XPrint Preview HWND_FRMPREVIEW, HWND_FRMPREVIEW_RICHEDIT1       
      XPrint Preview HWND_FRMPREVIEW, HWND_FRMPREVIEW_Picture1       
      'XPrint Preview HWND_FRMPREVIEW, HWND_FRMPREVIEW_GraphicControl1

      XPRINT "text"


Anyone see what I'm missing?

Thanks,
-John




Nathan Durland

Quote from: Knuth Konrad on February 08, 2014, 12:32:40 PM
A reporting component I use, which has a free "Community Edition" so that you can try it out, is Virtual Print Engine.

We use VPE (pro edition) on a daily basis.  We got it mostly for it's ability to natively save PDF files without CutePDF or the equivalent, but we also do graphing, emailing and all the fun stuff.

Petrus Vorster

VPE looks great. ANy examples anyone on how its used from Firefly ?
-Regards
Peter

Haakon Birkeland

Seems interesting, but after checking it out I feel good about staying with quickPDF for my programming meets designer cases. I use it in stand-alone applications for merchandise labels and on-line for datasheet generation with CMYK pictures and the lot.
Haakon 8o)