How to improve printing efficiency

Stimulsoft Reports.NET discussion
Post Reply
lampson
Posts: 42
Joined: Wed Dec 30, 2009 4:28 am

How to improve printing efficiency

Post by lampson »

Hi Edward .

1.I need to print multiple data using a same template ,in this case,How to improve printing efficiency?

My code:

for( int i = 0 ;i<n ;i++)
{
Report1.Reports.DataSources.Clear();
Report1.Reports.RegData( d1);
Report1.Reports.RegData(d2);
Report1.Reports.Load("1.mrt");
Stimulsoft.Report.Print.StiPrinterSettings p = new Stimulsoft.Report.Print.StiPrinterSettings();
p.ShowDialog = false;
Report1.Reports.PrinterSettings = p;
Report1.Reports.Print();
}

2.In the first printing,why is printing, the program will have no response to ,and process CSC.exe did not respond .

Thank you !
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to improve printing efficiency

Post by Jan »

Hello,

Please try to use way:

Code: Select all

Report1.Reports.Load("1.mrt");
Report1.Reports.Compile();

for( int i = 0 ;i<n ;i++)
{
Report1.Reports.CompiledReport.DataSources.Clear();
Report1.Reports.CompiledReport.RegData( d1[i]);
Report1.Reports.CompiledReport.RegData(d2[i]);

Stimulsoft.Report.Print.StiPrinterSettings p = new Stimulsoft.Report.Print.StiPrinterSettings();
p.ShowDialog = false;

Report1.Reports.CompiledReport.PrinterSettings = p;
Report1.Reports.CompiledReport.Render();
Report1.Reports.CompiledReport.Print();
}
Thank you.
lampson
Posts: 42
Joined: Wed Dec 30, 2009 4:28 am

How to improve printing efficiency

Post by lampson »

I will try it .

thank you very much !:biggrin:
lampson
Posts: 42
Joined: Wed Dec 30, 2009 4:28 am

How to improve printing efficiency

Post by lampson »

Hello ,

Can help check the code where there are problems do

Code: Select all

 stiReport1.Load(@"\1.mrt");

            stiReport1.Compile();

            stiReport1.CompiledReport.DataSources.Clear();

            DataTable dt1 = new DataTable();
            dt1 = GetTable(@"select 'abc' as qt1 from dual ");

            stiReport1.CompiledReport.RegData(dt1.DefaultView);

             stiReport1.CompiledReport.Print();
1.mrt :







view

QT1,System.String


view
view






EngineV2




None;Black;2;Solid;False;4;Black
Transparent


All;[105:105:105];1;Solid;False;4;[105:105:105]
White
7.8,3.2,7,1.6

Arial,30,Bold
0,0,0,0
Text1


{view.QT1}
Black


All;[105:105:105];1;Solid;False;4;[105:105:105]
White
5.4,3.2,2.4,1.6

Arial,30,Bold
0,0,0,0
Text2


QT1
Black



6f421fc5fa0a4375aeb55d3964a8fa86
1,1,1,1
Page1

29.7
21


Arial,100
[50:0:0:0]





System.Dll
System.Drawing.Dll
System.Windows.Forms.Dll
System.Data.Dll
System.Xml.Dll
Stimulsoft.Controls.Dll
Stimulsoft.Base.Dll
Stimulsoft.Report.Dll

ReportsTest
3/15/2010 9:43:54 AM
3/15/2010 9:43:12 AM

4df0d70400ab4c499ace6e7a276f3975
ReportsTest
Centimeters
2009.3.600
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;

namespace Reports
{

public class ReportsTest : Stimulsoft.Report.StiReport
{

public ReportsTest()
{
this.InitializeComponent();
}
#region StiReport Designer generated code - do not modify#endregion StiReport Designer generated code - do not modify
}
}

CSharp

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to improve printing efficiency

Post by Jan »

Hello,

Please replace following line of code:

Code: Select all

stiReport1.CompiledReport.DataSources.Clear();
by

Code: Select all

stiReport1.CompiledReport.DataStore.Clear();
Thank you.
lampson
Posts: 42
Joined: Wed Dec 30, 2009 4:28 am

How to improve printing efficiency

Post by lampson »

Hello,
There are still problems , only the static field has the value ,dynamic binding no value , very strange .

There is another problem : sometimes, at compile reports, csc.exe program will die。。。

Thank you .
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How to improve printing efficiency

Post by Andrew »

Hello,

Could you, please send a sample project to support@stimulsoft.com.

Thank you.
Post Reply