Print Page | Close Window

MakupLabel and CreateMarkupPrintView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17676
Printed Date: 24 April 2024 at 5:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MakupLabel and CreateMarkupPrintView
Posted By: j.godas
Subject: MakupLabel and CreateMarkupPrintView
Date 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



Replies:
Posted By: jpbro
Date 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



Posted By: Oleg
Date Posted: 15 December 2010 at 2:55am
Hello,

Thanks, very good suggestion. Implemented for next release.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date 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



Posted By: Oleg
Date Posted: 16 December 2010 at 3:47am
Hi,

Both added.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date 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



Posted By: jpbro
Date 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



Posted By: Oleg
Date 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


Posted By: jpbro
Date 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



Posted By: Hannes
Date 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 :(:(:(
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net