Printing AX-V7 in .NET using the PrintDocument???

TeeChart for ActiveX, COM and ASP
Post Reply
Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Printing AX-V7 in .NET using the PrintDocument???

Post by Alex » Mon Nov 29, 2004 12:29 pm

Hi all!

Is it possible to print Tcharts using the .net-printdocument, so I can use the .net print preview and all of the other document related stuff of VS?
I need to place more (>2) Tcharts and mixed graphics on a single page?

If yes, can somebody post me a short coding example for VB?

Thanks in advance!

Alex

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Feb 03, 2005 1:44 pm

Hi Alex,

yes, this can be done. The best way is by exporting the Chart image to stream, and then when you need to print it, import the stream as an image and draw it on the Print Document, using the DrawImage method in the PrintPage event.

Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Post by Alex » Thu Feb 03, 2005 3:56 pm

Hi Pep,

thanks for the hint. I came to a similar solution to print on multiple pages using this method.
If someone looks for the code I use:

Code: Select all

                Dim TStream As New System.IO.MemoryStream
                FGrafik.TChart1.Export.Image.Metafile.Save(TStream)
                TStream.Position = 0
                Dim be_test As New Imaging.Metafile(TStream)
                e.Graphics.DrawImage(be_test, 25, 40, 250, 350)
                be_test.Dispose()
But what I still want to know: I use a metafile format, this is according to the definition a real vector format. E.g. I draw in TChart a polygon (x/y), why do the lines are splitted up in x/y resultion? Instead of my 10 point polygon I get a 40 point polygon based on the resultion of the metafile. Why are the lines not a single line between my polgon points? Is the basis of a metafile still "pixel"?

Thanks another time!

Regards

Alex

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 11, 2005 3:03 pm

Hi Alex,
But what I still want to know: I use a metafile format, this is according to the definition a real vector format. E.g. I draw in TChart a polygon (x/y), why do the lines are splitted up in x/y resultion? Instead of my 10 point polygon I get a 40 point polygon based on the resultion of the metafile. Why are the lines not a single line between my polgon points? Is the basis of a metafile still "pixel"?
How can I see what you refer ? Could you please show me the code you're using to reproduce this behaviour ?

Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Post by Alex » Tue Feb 15, 2005 3:33 pm

Hi Pep,

yes, of course. I think it's the best that I post two small pictures where you can see my problem. How can I send you these pictures?

Best regards

Alex

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 15, 2005 3:41 pm

Hi Alex,

Please post them at the steema.public.attachments newsgroup available at news://www.steema.net.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Post by Alex » Wed Feb 16, 2005 12:35 pm

Hi Pep,

images and questions are posted.

Narcis, thanks for the link.

Best regards

Alex

Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Post by Alex » Mon Feb 28, 2005 2:33 pm

Hi Support!

Some comments to the pictures? Should I start a new thread?

Regards

Alex

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 01, 2005 4:54 pm

Hi Alex,

An example project has been attached to a reply to your message in the steema.public.attachments newsgroup.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Alex
Newbie
Newbie
Posts: 38
Joined: Tue Aug 31, 2004 4:00 am
Location: Austria/Europe

Post by Alex » Sat Mar 05, 2005 10:55 am

Hi Narcis,

thanks for the posting. This problem was still solved according Pep's hint (the same way like your posting).

Concerning the EMF quality I will start a new thread.

Regards

Alex

Post Reply