Hi,
I have created a UserControl (ascx) with the Report Viewer. I am creating instances of my report classes dynamically. My Report viewer code looks like this:
if (!Page.IsPostBack) |
{ |
if (!string.IsNullOrEmpty(_reportName)) |
{ |
PageManagementDataContext db = new PageManagementDataContext(); |
var rec = db.ReportGetByReportIDAndLCID(Convert.ToInt32(_reportName), "is-IS").FirstOrDefault(); |
if (rec != null) |
{ |
Object obj = Activator.CreateInstance(Type.GetType("Orbit.Benjamin.Reports." + rec.systemname)); |
Telerik.Reporting.Report rpt = (Telerik.Reporting.Report)obj; |
ReportViewer1.Report = rpt; |
ReportViewer1.ZoomMode = Telerik.ReportViewer.WebForms.ZoomMode.Percent; |
ReportViewer1.ZoomPercent = 100; |
ReportViewer1.Style["height"] = "30cm"; |
} |
} |
} |
} |
protected object GetNewType(string classname) |
{ |
Type type = Type.GetType(classname, true); |
object newInstance = Activator.CreateInstance(type); |
return newInstance; |
} |
var enterpr = db.EnterprisesAndDivisionsGetAll().Where(d => d.partyroleid != 4); |
var parameter = this.ReportParameters["Company"]; |
parameter.UI.AvailableValues.DataSource = enterpr.Select(o => o.partyname); |
parameter.Value = enterpr.Select(o => o.id); |
Hi guys,
I am working on an application which uses Telerik Reports to generate reports using the PDF rendering extension. The reporting logic in the application allows the users to schedule the reports generation. Because of performance and scalability reasons, the reports are generated (rendered to PDF) each on a different thread.
Now, imagine that different users schedule the same report but with different parameters to run at the same time. We would then have multiple calls to the Telerik.Reporting.Processing.ReportProcessor.Render method from different threads, passing to each call a different instance of the same Telerik.Reporting.Report class. It seems that there are some problems with this scenario. The reports will be rendered, but some of them with errors like "An error has occured while processing TextBox 'TextBox1': Index was outside the bounds of the array.".
I believe that thread safety is a very important functionality, therefore I hope you have a workaround for this or at least consider fixing it as soon as possible.
Regards,
Daniel
<system.webServer> |
<validation validateIntegratedModeConfiguration="false"/> |
...... |
...... |
...... |
<handlers> |
<remove name="WebServiceHandlerFactory-Integrated"/> |
<remove name="ScriptHandlerFactory" /> |
<remove name="ScriptHandlerFactoryAppServices" /> |
<remove name="ScriptResource" /> |
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" |
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
<add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" |
type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" |
preCondition="integratedMode,runtimeversionv2.0" /> |
</handlers> |
</system.webServer> |
Public Sub New()
InitializeComponent()
Dim mobjCert As New objCertificate(mJobNumber)
Dim MySubReport As Telerik.Reporting.SubReport
Dim mobjTemplate As New objTemplate(mobjCert.TemplateCode)
For tempcounter As Int16 = 1 To mobjTemplate.Count
AddTestSubReports(MySubReport, mobjTemplate.TestCode(tempcounter - 1),
"Test " + tempcounter.ToString + " " + mobjTemplate.TestTitle(tempcounter - 1))
Next
End Sub
Private Sub AddTestSubReports(ByVal MySubReport As Telerik.Reporting.SubReport, ByVal mTestCode As String, ByVal mTestTitle As String)
MySubReport =
New Telerik.Reporting.SubReport
MySubReport.Size =
New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(15.082725524902344, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(1.7001994848251343, Telerik.Reporting.Drawing.UnitType.Cm))
MySubReport.Style.Padding.Bottom =
New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)
MySubReport.Dock = System.Windows.Forms.DockStyle.Top
MySubReport.Top =
New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)
MySubReport.Name =
"SubReport2"
MySubReport.Style.BorderColor.Default = System.Drawing.Color.MidnightBlue
MySubReport.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
MySubReport.Style.Color = System.Drawing.Color.Transparent
Dim mobjTestTest As New objTestTest(mTestCode)
Dim mobjHeaders As New objTestHeading(mTestCode)
Dim txtTemp As New Telerik.Reporting.TextBox
Dim SubRep As New CertificatTestSubRep1
MySubReport.ReportSource = SubRep
SubRep.txtTestName.Value = mTestTitle
DeleteUnwantedSubRepItems(mobjHeaders.Count, SubRep, mobjHeaders)
SubRep.DataSource = mobjTestTest.dtTestTest
Me.DetailSection1.Items.Add(MySubReport)
End Sub
many thanks
Alo
public int advertiserID { get; set; } |
public DateTime startDate { get; set; } |
public DateTime endDate { get; set; } |
public EmailPromotionReport() |
{ |
/// <summary> |
/// Required for telerik Reporting designer support |
/// </summary> |
InitializeComponent(); |
this.NeedDataSource += new System.EventHandler(this.EmailPromotionReport_NeedDataSource); |
} |
private void EmailPromotionReport_NeedDataSource(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender; |
report.DataSource = (FarranMedia.Classes.Promotions.GetMailingsByAdvertiser(advertiserID,startDate,endDate)).Tables[0]; |
} |
Reporting.EmailPromotionReport reportBlast = new Reporting.EmailPromotionReport(); |
reportBlast.advertiserID = advertiserID; |
reportBlast.startDate = Convert.ToDateTime("1/1/07"); |
reportBlast.endDate = DateTime.Today; |
ReportViewer1.Report = reportBlast; |
<httpHandlers> |
<remove verb="*" path="*.asmx"/> |
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add path="Telerik.ReportViewer.axd" verb="*" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> |
</httpHandlers> |
....... |
....... |
....... |
....... |
<system.webServer> |
<validation validateIntegratedModeConfiguration="false"/> |
...... |
...... |
...... |
<handlers> |
<remove name="WebServiceHandlerFactory-Integrated"/> |
<remove name="ScriptHandlerFactory" /> |
<remove name="ScriptHandlerFactoryAppServices" /> |
<remove name="ScriptResource" /> |
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" |
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
<add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode,runtimeversionv2.0" /> |
</handlers> |
</system.webServer> |