Stimulsoft Reports.Net
www.stimulsoft.com

Welcome Guest Search | Active Topics | Members | Log In | Register

How to improve printing efficiency Options
lampson
Posted: Friday, March 12, 2010 3:29:48 AM
Rank: Member
Groups: Member

Joined: 12/30/2009
Posts: 16
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[i]);
Report1.Reports.RegData(d2[i]);
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
Posted: Friday, March 12, 2010 4:16:10 PM
Rank: Advanced Member
Groups: Administration, Stimulsoft Team

Joined: 2/19/2009
Posts: 952
Hello,

Please try to use way:
Code:

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
Posted: Monday, March 15, 2010 2:01:35 AM
Rank: Member
Groups: Member

Joined: 12/30/2009
Posts: 16
I will try it .

thank you very much !Big grin
lampson
Posted: Monday, March 15, 2010 3:42:00 AM
Rank: Member
Groups: Member

Joined: 12/30/2009
Posts: 16
Hello ,

Can help check the code where there are problems do

Code:

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 :

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<StiSerializer version="1.0" application="StiReport">
<Dictionary Ref="1" type="Dictionary" isKey="true">
<Databases isList="true" count="0" />
<DataSources isList="true" count="1">
<view Ref="2" type="Stimulsoft.Report.Dictionary.StiDataViewSource" isKey="true">
<Alias>view</Alias>
<Columns isList="true" count="1">
<value>QT1,System.String</value>
</Columns>
<Dictionary isRef="1" />
<Name>view</Name>
<NameInSource>view</NameInSource>
</view>
</DataSources>
<Relations isList="true" count="0" />
<Report isRef="0" />
<Variables isList="true" count="0" />
</Dictionary>
<EngineVersion>EngineV2</EngineVersion>
<GlobalizationStrings isList="true" count="0" />
<MetaTags isList="true" count="0" />
<Pages isList="true" count="1">
<Page1 Ref="3" type="Page" isKey="true">
<Border>None;Black;2;Solid;False;4;Black</Border>
<Brush>Transparent</Brush>
<Components isList="true" count="2">
<Text1 Ref="4" type="Text" isKey="true">
<Border>All;[105:105:105];1;Solid;False;4;[105:105:105]</Border>
<Brush>White</Brush>
<ClientRectangle>7.8,3.2,7,1.6</ClientRectangle>
<Conditions isList="true" count="0" />
<Font>Arial,30,Bold</Font>
<Margins>0,0,0,0</Margins>
<Name>Text1</Name>
<Page isRef="3" />
<Parent isRef="3" />
<Text>{view.QT1}</Text>
<TextBrush>Black</TextBrush>
</Text1>
<Text2 Ref="5" type="Text" isKey="true">
<Border>All;[105:105:105];1;Solid;False;4;[105:105:105]</Border>
<Brush>White</Brush>
<ClientRectangle>5.4,3.2,2.4,1.6</ClientRectangle>
<Conditions isList="true" count="0" />
<Font>Arial,30,Bold</Font>
<Margins>0,0,0,0</Margins>
<Name>Text2</Name>
<Page isRef="3" />
<Parent isRef="3" />
<Text>QT1</Text>
<TextBrush>Black</TextBrush>
</Text2>
</Components>
<Conditions isList="true" count="0" />
<Guid>6f421fc5fa0a4375aeb55d3964a8fa86</Guid>
<Margins>1,1,1,1</Margins>
<Name>Page1</Name>
<Page isRef="3" />
<PageHeight>29.7</PageHeight>
<PageWidth>21</PageWidth>
<Report isRef="0" />
<Watermark Ref="6" type="Stimulsoft.Report.Components.StiWatermark" isKey="true">
<Font>Arial,100</Font>
<TextBrush>[50:0:0:0]</TextBrush>
</Watermark>
</Page1>
</Pages>
<PrinterSettings Ref="7" type="Stimulsoft.Report.Print.StiPrinterSettings" isKey="true" />
<ReferencedAssemblies isList="true" count="8">
<value>System.Dll</value>
<value>System.Drawing.Dll</value>
<value>System.Windows.Forms.Dll</value>
<value>System.Data.Dll</value>
<value>System.Xml.Dll</value>
<value>Stimulsoft.Controls.Dll</value>
<value>Stimulsoft.Base.Dll</value>
<value>Stimulsoft.Report.Dll</value>
</ReferencedAssemblies>
<ReportAlias>ReportsTest</ReportAlias>
<ReportChanged>3/15/2010 9:43:54 AM</ReportChanged>
<ReportCreated>3/15/2010 9:43:12 AM</ReportCreated>
<ReportFile />
<ReportGuid>4df0d70400ab4c499ace6e7a276f3975</ReportGuid>
<ReportName>ReportsTest</ReportName>
<ReportUnit>Centimeters</ReportUnit>
<ReportVersion>2009.3.600</ReportVersion>
<Script>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
}
}
</Script>
<ScriptLanguage>CSharp</ScriptLanguage>
<Styles isList="true" count="0" />
</StiSerializer>
Jan
Posted: Monday, March 15, 2010 8:52:55 AM
Rank: Advanced Member
Groups: Administration, Stimulsoft Team

Joined: 2/19/2009
Posts: 952
Hello,

Please replace following line of code:

Code:
stiReport1.CompiledReport.DataSources.Clear();


by

Code:
stiReport1.CompiledReport.DataStore.Clear();


Thank you.
lampson
Posted: Monday, March 15, 2010 11:27:37 AM
Rank: Member
Groups: Member

Joined: 12/30/2009
Posts: 16
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
Posted: Wednesday, March 17, 2010 9:09:45 AM
Rank: Advanced Member
Groups: Stimulsoft Team

Joined: 6/9/2006
Posts: 1,133
Hello,

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

Thank you.
Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum Rss Feed : RSS

Powered by Yet Another Forum.net version 1.0.1 - 2/27/2006
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.049 seconds.