Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > MarkupLabel Control
  New Posts New Posts RSS Feed - MakupLabel and CreateMarkupPrintView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MakupLabel and CreateMarkupPrintView

 Post Reply Post Reply
Author
Message
j.godas View Drop Down
Newbie
Newbie
Avatar

Joined: 25 November 2009
Location: Spain
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote j.godas Quote  Post ReplyReply Direct Link To This Post Topic: MakupLabel and CreateMarkupPrintView
    Posted: 14 December 2010 at 4:10pm
I am trying to use printpreview.createMarkupPrintView from a markupLabel  generate using makupUIElment.
The problem is that createMarkupPrintView only works if markuplabel.caption is full of XAML code. But if you build your XAML content using  makupUIElment and his CJ objects, I can find the way to see the XAML code generated.

Somebody knows how solve the problem?

There is other way, try to export markup content to a context device. I saw some sample, but is not implemented for ACTIVE X Code., isn't it?

A simple sample:
------------------------------------------------------
Dim TextBlock1 As MarkupTextBlock
Dim Border As MarkupBorder
Dim Context As MarkupContext

Set Context = MarkupLabel1.MarkupContext
Set TextBlock1 = Context.CreateObject("TextBlock")
TextBlock1.Text = "Test1"
TextBlock1.TextAlignment = xtpMarkupTextAlignmentCenter
Set TextBlock1.Background = Context.CreateSolidBrush(vbRed)
Set Border = Context.CreateObject("Border")
Set Border.Child = TextBlock1
Set MarkupLabel1.MarkupUIElement = Border

'now the markup has contents, but markuplabel1.caption is empty!!

PrintPreview.PrintView = PrintPreview.CreateMarkupPrintView(MarkupLabel1.Caption)


Product: Xtreme SuitePro ActiveX Ver. 13.4.2
Platform: Windows XP, Windows 7
www.krontime.com
Language: Vb6
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2010 at 8:06pm
I think you need an IPrintView interface exposed for the MarkupLabel, and I couldn't find one :(

This would be a great request, unless there is a way to do it that I don't know...
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 December 2010 at 2:55am
Hello,

Thanks, very good suggestion. Implemented for next release.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 15 December 2010 at 9:07am
You guys are on a roll, thanks a lot! Is there also a PrintToDc method, or just an IPrintView interface?


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2010 at 3:47am
Hi,

Both added.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2010 at 9:18am
Awesome Oleg - can't wait for V15, thanks for all of your hard work.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2010 at 9:22am
I'm not sure how what the PrintToDc parameters are, so I'm just thinking out loud here:

I have a "dashboard" view that has summary information, charts, etc... in various ScrollViewers and I would like to be able to print this on separate pages. It would be perfect if we could pass a MarkupUiElement to the PrintToDc method, and it would just print that element and it's children.

This would allow me to have a Grid in a ScrollViewer that would be scrollable while on screen, but I could pass the Grid object to the PrintToDc method to print the Grid without the ScrollViewer scrollbars appearing on the output - is this how it works, and if not can it be implemented to work this way?

Thanks for any feedback.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 December 2010 at 5:04am
Hi,

Added additional  PrintElementToDC(OLE_HANDLE hDC, MarkupUIElement* Element, int Left, int Top, int Width, int Height) method.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 20 December 2010 at 8:44am
I'm very impressed and grateful Oleg. Thank you very much. Clap
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Hannes View Drop Down
Newbie
Newbie
Avatar

Joined: 15 April 2013
Location: Warschau
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hannes Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2013 at 1:55pm
Hi !
I'm new using CodeJock, so sorry for any "stupid" questions in advanced.
 
I use CodeJock in BorlandBuilder and try to use PrintPreview to print XAML strings.
Following example from help, made in VB, I keep trying sth like that (having PrintPreview control on the Form):
 
...
IPrintView *ipw;
ipw = MyPrintPreview->CreateMarkupPrintView(XAMLString); /* MyPrintPreview is an object of TPrintPreview of course*/
 
MyPrintPreview->PrintView = ipw;
/* and the line above generate error : 'TPrintPreview::PrintView' is not accessible */
 
 
Please, anybody help me, because I've lost my hope after many many days of looking for solution of this problem using help of Uncle Google, this forum and help of CodeCojcke :(:(:(
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.