Hello,
I'd like to create a custom header for the printing of a daily, weekly, or monthly calendar.
I have set IncludeDateHeaderArea = false
How do I go about extracting the text that was in the header area so I can place it in my custom header, for example July 2017 ?
Thanks in advance
Hello Anthony,
If you need to show some static text you may set a Header for your print document like this:
this.ultraSchedulePrintDocument1.IncludeDateHeaderArea = false;this.ultraSchedulePrintDocument1.Header.Height = 30;this.ultraSchedulePrintDocument1.Header.TextLeft = "SOME CUSTOM TEXT";this.ultraSchedulePrintDocument1.Header.Appearance.FontData.Bold = DefaultableBoolean.True;this.ultraSchedulePrintDocument1.Header.Appearance.FontData.SizeInPoints = 19;
However, if what you need is some custom text, depending on what is shown originally in date header area you will need to implement your own Creation Filter. There you can add new UIElements as you need and remove the unnecessary ones. Attached is a sample project where I am showing both approaches, considering PrintStyle is set to its default value – Daily.
Please check my sample and let me know if this is what you are looking for, or if I am missing something.
Thank you, this is pretty close to what I was looking for.
My final question would be is there any way to extract the DateHeaderArea text so that I could use it in the custom header.
So where you have:
ultraSchedulePrintDocument1.Header.TextLeft = "SOME CUSTOM TEXT"
I could do something like:
ultraSchedulePrintDocument1.Header.TextLeft = "SOME CUSTOM TEXT " + dateHeaderAreaDateElement.Text