Printing to Word Document or PDF file

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by cnwmjn1 >> Tue, 13 May 2003 0:00:39 GMT

We have a requirement to create a file from existing reports and email this. It seems that either a Word document or a PDF file would be the best alternatives since almost all users would be able to read these without requiring any additional local software.

Has anyone successfully achieved this? If so, can you please advise how you went about it.

We do not want to have to modify all the reports and also, since the output is financial data and therefore formatted, we do not want to lose the column formatting. Proportional fonts in Word would be a problem here.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by peterb >> Tue, 13 May 2003 3:01:17 GMT

It may not suit your requirements but have you tried win2pdf (www.win2pdf.com) . I use this all the time for converting Jade reports into PDFs before emailing. If you're converting just a few reports this will suit fine but it could be a hassle if you want to do large amounts. It just acts as a printer driver and converts the output into a PDF file. Very simple.

Peter

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by allistar >> Tue, 13 May 2003 4:19:17 GMT

Hi there,
We have code that converts a report output into raw HTML which can then be emailed. This is a good solution as you aren't making any assumptions about what software the receiver has installed (except for a browser, which would be a given anyway). There's nothing worse than receiving a .doc file when you don't have MS Office installed (horay for OpenOffice.org). PDF's are better as it is an open (albiet proprietary) format.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by cnwmjn1 >> Tue, 13 May 2003 4:56:44 GMT

Allistar

I agree with your sentiments, and that sounds the ideal way, but I have some questions.

When you say "converts a report output into raw HTML" how does this work? In what form does the output need to be created? And do you get a file that can be emailed, or is the report sent as the email message?

Bear in mind that the reports we need to email are existing report code which we do not want to have to modify, though we can easily capture the report output to the JadeReportData classes then append some code to do what we need to from there.

Regards

Murray

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by allistar >> Tue, 13 May 2003 10:04:23 GMT

Hi Murray,
We have our own report writer written in Jade. The output of a report is a collection of pages, and a page is a collection of labels (with top, left, width, caption etc. set accordingly). The code that converts this to HTML works something like this:

- each page is a new HTML table
- the labels are all lined up in transient memory structures, essentially breaking the page into a collection of lines, where a line is a collection of labels.
- each line is a row in the HTML table.
- if the positioning of the columns in the row differ from one line to the next then a new HTML table is created, otherwise a new HTML row is added to the existing table. (The code that does this has some cleverness built in to account for columns that are missing and columns that don't quite line up).
- what is returned is a String (the size of which depends on the number of pages in the report).

This String can then be saved as a file, emailed directly or displayed in a browser. We have used JHP (www.silvermoon.co.nz/jhp.html) to interface this code to an Apache webserver which allows users to schedule reports via a web page and view the results on a web page, without needing any special Jade software. Any browser is all that's required.

I would image the way a Jade report writer report is output is the same as (if not similar to) our format (that is a colection of pages, which each page is a collection of labels).

It doesn't yet handle for images embedded in the report, but it does deal with fonts, colours, sizes, and styles quite well.

What we do it run a report, and once we have its output we HTMLise it instead of giving it to a printer. Given that I see no reason why you would need to modify your existing reports.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by cnwjhp1 >> Tue, 13 May 2003 9:17:59 GMT

Allistar, last I knew Microsoft offered a freeware Word document reader.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by allistar >> Tue, 13 May 2003 9:53:27 GMT

It's a shame it only runs on Windows, meaning I can't use it on my home machine (the computer I am using now).

Allistar. ------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by encos_dev >> Wed, 14 May 2003 23:11:06 GMT

We have the same problem, ie wanting to e-mail reports. We couldn't go down the HTML route as a lot of our reports have images (digitally captured signatures from a PDA). So we went with the PDF Printer Driver solution & are using www.pdf995.com for this.

Glen
Encos

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by allistar >> Thu, 15 May 2003 2:53:28 GMT

Hi Glen,
Pleased to hear that you have a solution, and thanks for the tip about the pdf tool you use, I'll have a look (I'm working on adding pdf and fax output facilities into one of my clients products).

It would be possible to embed images in the HTML, it would just take some clever code to insert the image into the HTML in the correct place. Some mail clients (though not all) allow you to "inline" images, meaning the image attachments appear embedded in the HTML in the correct place.
Glen
Encos

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Printing to Word Document or PDF file

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:22 pm

by StephenBarker >> Thu, 15 May 2003 23:41:50 GMT

Glen,
I am looking for a pdf solution for a report server app running Report Writer.
Are you using pdf995 on a server or client ? Do you know if it will run ok on a server with the basic $10 licence and can you set file name via the setOutputFileTitle method ?
thanks Stephen


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 9 guests

cron