How to print many pages that I can enter

Hi Everyone, I have a problem to ask. I want to print a report that I can enter a number.
If I enter 2, and print 2 pages report the same.
If I enter 3, and print 3 pages report the same.
I use Maskedtextbox in dialog and it can enter number.
the information is in database , and I use SQL command to select data.
I post a part of code like below:

namespace FastReport
{
public class ReportScript
{

private void Page1_StartPage(object sender, EventArgs e)
{

int count ;
count = Convert.ToInt32(MaskedTextBox1.Text);
count = int.Parse(MaskedTextBox1.Text);
int yy,mm,dd;
string cyy,cmm,cdd,str;

TableDataSource HDS = Report.GetDataSource("HDS") as TableDataSource;
str = "declare @i varchar(10) "+
"set @i= "+count+
" while(@i>;0) "+
" begin "+
"SELECT a.*,b.* from t_ordhad as a "+
"left join t_orddel as b on a.shtno = b.shtno "+
"where a.shtno = "+Report.GetColumnValue("HDS.shtno").ToString().Trim();
str = str+ " set @i=@i-1 end";
HDS.SelectCommand = str;
HDS.InitializeComponent();
HDS.Init();
}
}
}

but it can't run. Is there any parameter or function I can change the page count?
Thanks a lot!

Comments

  • DesignsbyrayDesignsbyray Ohio, USA
    edited 6:22PM
    I don't see where you are calling the report from the code you have posted. The report has a property you can set called: PrintSettings.Copies which takes a int. I think this may help you do what you want.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.