From: phil oakleaf on
Does any one have ideas about creating well formatted tables to display
on a printed report.

The data is not in any standard database format and the number of rows
may be up to 200 so I'd need to paginate in some way.

Ideally, I'd like to use CString text to create an HTML table then
combine with CSS - but is there a way to use Internet Explorer to render
this into a Bitmap that I can drop on the page?

Many thanks for any replies
From: David Lowndes on
>Ideally, I'd like to use CString text to create an HTML table then
>combine with CSS - but is there a way to use Internet Explorer to render
>this into a Bitmap that I can drop on the page?

Phil,

If you're creating an HTML table and want to use that with CSS in
Internet Explorer, why do you need to render to a bitmap?

Dave
From: Goran on
On Feb 11, 8:27 am, phil oakleaf <n...(a)oakleafsoftware.co.uk> wrote:
> Does any one have ideas about creating well formatted tables to display
> on a printed report.

Aren't there reporting solutions from 0 to hero on Google? ;-)

> The data is not in any standard database format and the number of rows
> may be up to 200 so I'd need to paginate in some way.

Paging is handled by any reporting tool, decent or not, I'd guess.
Also, if you use system printing APIs yourself, you are forced to do
it anyhow ;-)

> Ideally, I'd like to use CString text to create an HTML table then
> combine with CSS - but is there a way to use Internet Explorer to render
> this into a Bitmap that I can drop on the page?

You can certainly create HTML content in code, save it as file, and
open it in your browser, css included. You can issue "print" shell
command, too.

If you want to display it inside your program, you can try to use
IWebBrowser control, or better still it's MFC wrapper CHtmlView. I
would guess that handles "Print" command, but I never tried.

But whatever you do, DO NOT "RENDER INTO A BITMAP", though. World will
thank you ;-).

Goran.
From: phil oakleaf on
Goran wrote:
> On Feb 11, 8:27 am, phil oakleaf <n...(a)oakleafsoftware.co.uk> wrote:
>> Does any one have ideas about creating well formatted tables to display
>> on a printed report.
>
> Aren't there reporting solutions from 0 to hero on Google? ;-)
>
>> The data is not in any standard database format and the number of rows
>> may be up to 200 so I'd need to paginate in some way.
>
> Paging is handled by any reporting tool, decent or not, I'd guess.
> Also, if you use system printing APIs yourself, you are forced to do
> it anyhow ;-)
>
>> Ideally, I'd like to use CString text to create an HTML table then
>> combine with CSS - but is there a way to use Internet Explorer to render
>> this into a Bitmap that I can drop on the page?
>
> You can certainly create HTML content in code, save it as file, and
> open it in your browser, css included. You can issue "print" shell
> command, too.
>
> If you want to display it inside your program, you can try to use
> IWebBrowser control, or better still it's MFC wrapper CHtmlView. I
> would guess that handles "Print" command, but I never tried.
>
> But whatever you do, DO NOT "RENDER INTO A BITMAP", though. World will
> thank you ;-).
>
> Goran.
From the start of MFC I have been generating my own reports using a
horrible hack of C++.

What I'd like is a package that lets me defines 'objects' on a page
Tables, bitmaps etc. Give me full control over paper size and pagination
(seems to be a problem with HTML) and then generates a report that can
be previewed and printed.

I have Googled but if anyone here has experience of any packages or
techniques I'd be very appreciative.

Why not "Render into a Bitmap"? :)

Phil
From: Joseph M. Newcomer on
See below...
On Thu, 11 Feb 2010 15:35:44 +0000, phil oakleaf <news(a)oakleafsoftware.co.uk> wrote:

>Goran wrote:
>> On Feb 11, 8:27 am, phil oakleaf <n...(a)oakleafsoftware.co.uk> wrote:
>>> Does any one have ideas about creating well formatted tables to display
>>> on a printed report.
>>
>> Aren't there reporting solutions from 0 to hero on Google? ;-)
>>
>>> The data is not in any standard database format and the number of rows
>>> may be up to 200 so I'd need to paginate in some way.
>>
>> Paging is handled by any reporting tool, decent or not, I'd guess.
>> Also, if you use system printing APIs yourself, you are forced to do
>> it anyhow ;-)
>>
>>> Ideally, I'd like to use CString text to create an HTML table then
>>> combine with CSS - but is there a way to use Internet Explorer to render
>>> this into a Bitmap that I can drop on the page?
>>
>> You can certainly create HTML content in code, save it as file, and
>> open it in your browser, css included. You can issue "print" shell
>> command, too.
>>
>> If you want to display it inside your program, you can try to use
>> IWebBrowser control, or better still it's MFC wrapper CHtmlView. I
>> would guess that handles "Print" command, but I never tried.
>>
>> But whatever you do, DO NOT "RENDER INTO A BITMAP", though. World will
>> thank you ;-).
>>
>> Goran.
> From the start of MFC I have been generating my own reports using a
>horrible hack of C++.
*****
I have a generic printing function that allows pagination and headings. You can find it
on my MVP Tips site. However, it is not elegant, and is a sort of "line printer
simulator".
****
>
>What I'd like is a package that lets me defines 'objects' on a page
>Tables, bitmaps etc. Give me full control over paper size and pagination
>(seems to be a problem with HTML) and then generates a report that can
>be previewed and printed.
****
This is asking a lot. For example, HTML lets you define objects such as tables and
bitmaps, but the placement is at the mercy of the HTML renderer, which can be a problem.

You can look into things like rich edit control printing options, but they can be a pain
to use.

Note that if you set up your DC correctly, you can render anything you want onto a DC, but
things like pagination are still your problem. For some kinds of reports, where you need
to do "lookahead" to handle "grouping" on the same page, this can be a pain. There are
report add-ins like Crystal Reports, but I've never needed to do this so never looked into
them (they used to come with VS, but I don't know if they still do, for example)

Note that there are no universally-suitable packages; some packages are really nice for
recordset reporting, some are good for graphics rendering, but it gets tricky as you try
to do everything.
****
>
>I have Googled but if anyone here has experience of any packages or
>techniques I'd be very appreciative.
>
>Why not "Render into a Bitmap"? :)
****
Gigantic, resource hogs, limited capability (think about it: a 1200x1200 dpi printer needs
134 megapixels, and even if you only do B&W, this is a MASSIVE representation of
information. Better to let the printer render it for you. Even 600x600 is
33Mpixels/page.
joe
*****
>
>Phil
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm