Simulate the "DEMO" text
Posted: Mon Jan 07, 2008 5:28 am
I would like to simulate the "DEMO" text that you make appear in your demo version.
How can i do this?
Thanks.
How can i do this?
Thanks.
Reporting tool and data analytics tools for creating reports and dashboards in ASP.NET, ASP.NET MVC, .NET Core, Blazor, Angular, PHP, Python, WPF, JavaScript, and Java applications.
https://forum.stimulsoft.com/
Code: Select all
StiPage.PagePainted += new Stimulsoft.Report.Events.StiPagePaintEventHandler(DrawCopyright);
StiPage.PagePainting += new Stimulsoft.Report.Events.StiPagePaintEventHandler(DrawCopyright);
private void DrawCopyright(StiPage sender, Stimulsoft.Report.Events.StiPagePaintEventArgs e)
{
if (!e.IsDesigning)
{
StiPage page = sender as StiPage;
Rectangle rect = e.FullRectangle;
using (Font font = new Font("Arial", 20 * (float)page.Zoom))
{
using (StringFormat sf = new StringFormat())
{
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
e.Graphics.DrawString("(c) 2006/2007 Demo EDV Gradl Berlin", font, Brushes.Red, rect, sf);
}
}
}
}
Code: Select all
For Each page As Stimulsoft.Report.Components.StiPage In Report.Pages
page.Watermark.Text = "D E M O"
'The following lines adjust the font to make appear
'the full string so that it occupies the full space available.
'(Code taken from another thread)
Dim text As New Stimulsoft.Report.Components.StiText
text.ClientRectangle = page.ClientRectangle
text.Text.Value = page.Watermark.Text
text.Angle = page.Watermark.Angle
text.Page = page
text.Font = New System.Drawing.Font(page.Watermark.Font.FontFamily, 1020)
page.Watermark.Font = text.GetActualFont(page.Watermark.Text)
Next
Fabio wrote:Thanks.
I need to set the Watermark.Text on a report compiled but not rendered yet.
Alternatively i need to set the Watermark.Text on a loaded template.
Thanks.