multithreading - Multi threading in SSIS 2008 using Script Component with referenced custom DLL for SSRS Report Generation -


we have requirement in our project need generate reports our clients. these reports done using ssrs.

we having sql 2008r2 report server , ssis packages created done using 2008.

the report selection , format done based on business logic.the reports generated , saved common folder on server.

all logic have implemented within class library , created dll , registered gac.

we created 4 oledb source , script componenet whcih run paralled each other script component processes orders , generate report

all these 4 script component having the same dll referenced gac. when run ssis package, reports few orderd not getting created. when checked error log found below errors different orders.

error 1:

system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.invalidoperationexception: object in use elsewhere. @ system.drawing.image.get_height() @ microsoft.reporting.winforms.rvsplitcontainer.get_splitterwidth() @ microsoft.reporting.winforms.rvsplitcontainer.set_splitterdistance(int32 value) --- end of inner exception stack trace --- @ system.runtimemethodhandle._invokemethodfast(object target, object[] arguments, signaturestruct& sig, methodattributes methodattributes, runtimetypehandle typeowner) @ system.runtimemethodhandle.invokemethodfast(object target, object[] arguments, signature sig, methodattributes methodattributes, runtimetypehandle typeowner) @ system.reflection.runtimemethodinfo.invoke(object obj, bindingflags invokeattr, binder binder, object[] parameters, cultureinfo culture, boolean skipvisibilitychecks) @ system.reflection.runtimemethodinfo.invoke(object obj, bindingflags invokeattr, binder binder, object[] parameters, cultureinfo culture) @ system.reflection.runtimepropertyinfo.setvalue(object obj, object value, bindingflags invokeattr, binder binder, object[] index, cultureinfo culture) @ system.reflection.runtimepropertyinfo.setvalue(object obj, object value, object[] index) @ system.componentmodel.componentresourcemanager.applyresources(object value, string objectname, cultureinfo culture) @ system.componentmodel.componentresourcemanager.applyresources(object value, string objectname) @ microsoft.reporting.winforms.reportviewer.initializecomponent() @ microsoft.reporting.winforms.reportviewer..ctor() @ myproj.reporting.renderreport(list`1 param, string reportformat, string reporturl)

error 2 :

system.invalidoperationexception: object in use elsewhere. @ system.drawing.image.get_width() @ microsoft.reporting.winforms.rvsplitcontainer.get_splitterwidth() @ microsoft.reporting.winforms.rvsplitcontainer.set_splitterdistance(int32 value) @ microsoft.reporting.winforms.rvsplitcontainer.onresize(eventargs e) @ system.windows.forms.control.onsizechanged(eventargs e) @ system.windows.forms.control.updatebounds(int32 x, int32 y, int32 width, int32 height, int32 clientwidth, int32 clientheight) @ system.windows.forms.control.updatebounds(int32 x, int32 y, int32 width, int32 height) @ system.windows.forms.control.setboundscore(int32 x, int32 y, int32 width, int32 height, boundsspecified specified) @ system.windows.forms.control.setbounds(int32 x, int32 y, int32 width, int32 height, boundsspecified specified) @ system.windows.forms.control.set_size(size value) @ microsoft.reporting.winforms.rvsplitcontainer.initializecomponent() @ microsoft.reporting.winforms.rvsplitcontainer..ctor() @ microsoft.reporting.winforms.reportviewer.initializecomponent() @ microsoft.reporting.winforms.reportviewer..ctor() @ myproj.reporting.renderreport(list`1 param, string reportformat, string reporturl)

we wanted achieve multi threading functionality having different components create reports, above error not able make out needs corrected in order achieve desired output.

below code block generating error.

private static byte[] renderreport(list<reportparameter> param, string reportformat, string reporturl)     {         string[] streamids;         warning[] warnings;         byte[] reportoutput = null;         string mimetype, encoding, extension, deviceinfo;              using (reportviewer rptstandardreport = new reportviewer())             {                 rptstandardreport.serverreport.reportserverurl = new uri(settings.default.reportserver);                 rptstandardreport.serverreport.reportservercredentials.networkcredentials = new networkcredential(settings.default.reportserverusername, settings.default.reportserverpassword);                 rptstandardreport.serverreport.reportpath = reporturl;                 rptstandardreport.serverreport.setparameters(param);                 deviceinfo = "<deviceinfo><simplepageheaders>true</simplepageheaders></deviceinfo>";                 reportoutput = rptstandardreport.serverreport.render(reportformat, deviceinfo, out mimetype, out encoding, out extension, out streamids, out warnings);             }        } 

any suggestion or appreciated.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -