Merging formula print with other stuff...

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Version: 4.0.0261
Avatar
My users want to be able to print their formula (from the Syntax Editor) along with several attributes of the formula variable on the same page content. Is it possible for me to print application-specific information ahead of or following the syntax editor print output, or is there some way I can tell the syntax editor to print to an existing print context that I'm working on through my application? The attributes I'm talking about are much bigger than anything that would fit in a simple page header (and I wouldn't want them to appear on all pages), so I think print headings / footers wouldn't work for my purposes.

Sorry, this is a very vague question mostly because I haven't even looked into how I'd do the printing myself, so I haven't a very clear idea of how .NET printing works in general.

Thanks,

Kelly Leahy Software Architect Milliman, USA

Comments (6)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kelly,

I don't believe there is a way you can tie into the print system right now unfortunately. Perhaps load a second SyntaxEditor with your data, a copy of the text, and the same settings and print from that?


Actipro Software Support

Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
Can you tell me how, internally, you do you printing to the print context? Do you determine page breaks, set headers, etc. all on a drawing context on your own, or is there something in .NET you're using that helps you (that I might be able to pass into your code and have already printed some stuff to it)?

I'm just not sure how printing works in .NET and didn't know if you have some way that I could 'help' print some stuff to the page :)

I don't think the 'second' syntax editor approach will do me much good, since all the syntax highlighting would get screwy once the other stuff is put into the document, unless, of course, I put them in as comments or something.

Thanks,

Kelly Leahy Software Architect Milliman, USA

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sure, SE attaches to the PrintDocument's BeginPrint, PrintPage, and EndPrint events. In BeginPrint it intializes a custom view. In PrintPage it sequentially prints the text of each page after taking into account the page header/footer. It draws those too. Then in EndPrint it cleans up. You may be able to hook into the PrintPage event and block the printing from ending on the last page to print your own stuff on an additional "last" page and then flag it as ending. But that hasn't been tried and may or may not work.

For the other suggestion about an external SyntaxEditor used for printing, what about creating a merged two languages where one is your data (plain colored) then at some delimiter, transition to your normal language for the rest?


Actipro Software Support

Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
Hehehe.... well, I just went through a ton of work to make my language a nonmergable language... I guess that wasn't the best investment looking back!

Kelly

Kelly Leahy Software Architect Milliman, USA

Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
When you say a 'custom view', do you mean a SyntaxEditor view, or do you mean something else?

Kelly Leahy Software Architect Milliman, USA

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes it's a custom EditorView that is used for printing the contents of a SyntaxEditor.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.