How to add PageNofM???
-
- Posts: 85
- Joined: Sat Jan 20, 2007 4:21 am
How to add PageNofM???
Hi,
i want to add page number in system text at run time.so i tried following,
StiPageFooterBand PageFooterBand1 = new Stimulsoft.Report.Components.StiPageFooterBand();
PageFooterBand1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 10.71, 7.49, 0.2);
PageFooterBand1.Dock = System.Windows.Forms.DockStyle.Bottom;
PageFooterBand1.Name = "PageFooterBand1";
PageFooterBand1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None, System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
PageFooterBand1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent);
page.Components.Add(PageFooterBand1);
StiSystemText SystemText1 = new Stimulsoft.Report.Components.StiSystemText();
SystemText1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0, 7.49, 0.2);
SystemText1.Dock = System.Windows.Forms.DockStyle.Fill;
SystemText1.HorAlignment = Stimulsoft.Base.Drawing.StiTextHorAlignment.Right;
SystemText1.Name = "SystemText1";
SystemText1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.Top, System.Drawing.Color.DimGray, 0.5, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
SystemText1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent);
SystemText1.Font = new System.Drawing.Font("Arial Unicode MS", 8F);
SystemText1.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
SystemText1.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black);
SystemText1.TextFormat = new Stimulsoft.Report.Components.TextFormats.StiGeneralFormatService();
SystemText1.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F, System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
PageFooterBand1.Components.Add(SystemText1);
But i dont know, how to add PageNofM???
Please Provide the solution....
Thanks in advance,
Jaykumar
i want to add page number in system text at run time.so i tried following,
StiPageFooterBand PageFooterBand1 = new Stimulsoft.Report.Components.StiPageFooterBand();
PageFooterBand1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 10.71, 7.49, 0.2);
PageFooterBand1.Dock = System.Windows.Forms.DockStyle.Bottom;
PageFooterBand1.Name = "PageFooterBand1";
PageFooterBand1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None, System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
PageFooterBand1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent);
page.Components.Add(PageFooterBand1);
StiSystemText SystemText1 = new Stimulsoft.Report.Components.StiSystemText();
SystemText1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0, 7.49, 0.2);
SystemText1.Dock = System.Windows.Forms.DockStyle.Fill;
SystemText1.HorAlignment = Stimulsoft.Base.Drawing.StiTextHorAlignment.Right;
SystemText1.Name = "SystemText1";
SystemText1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.Top, System.Drawing.Color.DimGray, 0.5, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
SystemText1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent);
SystemText1.Font = new System.Drawing.Font("Arial Unicode MS", 8F);
SystemText1.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
SystemText1.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black);
SystemText1.TextFormat = new Stimulsoft.Report.Components.TextFormats.StiGeneralFormatService();
SystemText1.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F, System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
PageFooterBand1.Components.Add(SystemText1);
But i dont know, how to add PageNofM???
Please Provide the solution....
Thanks in advance,
Jaykumar
How to add PageNofM???
What about:
SystemText1.Text = "{PageNofM}";
??
Marco
SystemText1.Text = "{PageNofM}";
??
Marco
-
- Posts: 85
- Joined: Sat Jan 20, 2007 4:21 am
How to add PageNofM???
Hi,
Systemtext1.Text="{PageNofM}"
The above statement doesn't work.
Please provide any other solutions....
Thanks in advance,
Jayakumar
Systemtext1.Text="{PageNofM}"
The above statement doesn't work.
Please provide any other solutions....
Thanks in advance,
Jayakumar
How to add PageNofM???
In the latest prerelease versions of StimulReport.Net StiText has some improvements. These improvements make a StiText component able fully Replace a StiSystemText component.
Creating and placement of the both components is the same.
Assigning the Text property of the StiText component in runtime you can do as following:
(report.Pages[0].GetComponents()["MyText"] as StiText).Text = "{PageNofM}";
This will work only for the reports' template, when the report later needs Compile() method. If you need add an aggregate function into the compiled report, then it is a bit more complex task.
Do you need add an aggregate function in the compiled report?
Thank you.
Creating and placement of the both components is the same.
Assigning the Text property of the StiText component in runtime you can do as following:
(report.Pages[0].GetComponents()["MyText"] as StiText).Text = "{PageNofM}";
This will work only for the reports' template, when the report later needs Compile() method. If you need add an aggregate function into the compiled report, then it is a bit more complex task.
Do you need add an aggregate function in the compiled report?
Thank you.
-
- Posts: 85
- Joined: Sat Jan 20, 2007 4:21 am
How to add PageNofM???
Hi,
I have Stimulsoft 2007.1. In that Version How to Add Page number using SystemText ?
And also i need ,aggregate function in the compiled report?
Thanks in Advance,
Jayakumar
I have Stimulsoft 2007.1. In that Version How to Add Page number using SystemText ?
And also i need ,aggregate function in the compiled report?
Thanks in Advance,
Jayakumar
How to add PageNofM???
If you need to do this in the Designer, then please use SystemText component from the ToolBox. After placing SystemText component on the page in the Editor of the component you should selectjayakumargr wrote:I have Stimulsoft 2007.1. In that Version How to Add Page number using SystemText ?
Code: Select all
{Page Number} or Page {Page Number} to {Total Page Count}
Code: Select all
{Page Number}
system variable.
Also you can use these system variables in the StiText standard component.
Please use the following code:jayakumargr wrote:And also i need ,aggregate function in the compiled report?
Code: Select all
// if report loaded from a template then use this line of code. If report is declared as class then this line of code is not necessary
report.Compile();
StiSystemText mySystemText = new StiSystemText(new RectangleD(new PointD(0, 0), new SizeD(20, 20)));
mySystemText.Name = "mySystemText";
// We place this component on the HeaderBand for example:
StiHeaderBand myHeader = report.CompiledReport.GetComponents()["HeaderBand1"] as StiHeaderBand;
myHeader.Components.Add(mySystemText);
mySystemText.GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler(mySystemText__GetValue);
report.CompiledReport.EndRender += new System.EventHandler(this.ReportWordsToEnd__EndRender);
report.Show();
...
public void mySystemText__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
e.Value = "";
e.StoreToPrinted = true;
}
public System.String mySystemText_GetValue_End(Stimulsoft.Report.Components.StiComponent component)
{
return report.CompiledReport.PageNofM.ToString();
}
public void ReportWordsToEnd__EndRender(object sender, System.EventArgs e)
{
(report.CompiledReport.GetComponents()["mySystemText"] as StiSystemText).SetText(new Stimulsoft.Report.Components.StiGetValue(mySystemText_GetValue_End));
}