Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addins and reflection, using reflection in an Addin
Message
 
 
To
11/02/2008 13:07:21
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01291548
Message ID:
01291687
Views:
6
Hi Brian,

Not an answer to your question, but you may also take a look at classes from
Kevin's blog.

See suggestions from Re: Quick Tutorial on CR Thread #1289549 Message #1289594

>I’m creating an addin to wrapper Crystal reports in a custom class for use in my ReportManager. The user will get a drop down listing all the projects in the current soloution. Next the user gets a list of all the crystal reports found in that project and can select which reports to create wrapper classes for. After selecting the crystal reports that the user want to wrapper. I want to create an instance of each of those crystal reports so that I can retrive parameter information along with other properties. This is where I’m running into problems. I get the Assembly for the project that has the reports loaded via
>cryAssembly=System.Reflection.Assembly.LoadFile(“the projects assembly”) This returns the assembley but when I try to create an instance of anything in the assembly it returns Null. Heres an example of what I'm trying to do.
>
>
>Dim CrystalReportName As String
>        Dim NewWrapper As WrapperBase
>        Dim oCrystalReport As CrystalDecisions.CrystalReports.Engine.ReportDocument
>        Dim strassem As String = GetAssemblyName()
>        'loop through all the reports selected by the user
>        For Each CrystalReportName In CrystalReportsList
>            'create a new wrapper for this report
>            NewWrapper = New WrapperBase
>            'set the name
>            NewWrapper.CrystalReportName = CrystalReportName
>            'create an instance of the report so we can get the parameters
>            Dim assemb As System.Reflection.Assembly
>            'load the assebly
>            assemb = System.Reflection.Assembly.LoadFile(strassem)
>            If Not (assemb Is Nothing) Then
>                'create the report
>                Dim objTest As Object = assemb.CreateInstance(System.IO.Path.GetFileNameWithoutExtension(CrystalReportName), True)
>                oCrystalReport = CType(objTest, CrystalDecisions.CrystalReports.Engine.ReportDocument)
>            End If
>            'Do some more stuff to finish the wrapper
>            Me.WrapperList.Add(NewWrapper)
>        Next
>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform