Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report name as variable?
Message
De
22/06/2004 13:53:03
 
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Divers
Thread ID:
00916127
Message ID:
00916131
Vues:
11
Hey Jeff,

I don't know anything about Crystal, but it sounds like you need to use reflection to get at this. Here's an example of using reflection:
string DLLName = "MyDLL";
string ClassName = "MyClass";
System.Reflection.Assembly oDLL;
object oClass;

// This "loads" the .DLL
oDLL = System.Reflection.Assembly.LoadFrom(DLLName);

// This creates the class instance
oClass = oDLL.CreateInstance(ClassName);
And if you need to pass parameters
// Create an instance of the desired form from the assembly
object [] args = new object[1];
args[0] = MyKey;
oForm = (Form)oDLL.CreateInstance(classname, true, System.Reflection.BindingFlags.CreateInstance, null, args, null, null);
I hope this points you in the right direction.

~~Bonnie


>Can I use a variable to instantiate a report?
>
>Like
>
>dim myreportname as string
>Dim orpt As CrystalDecisions.CrystalReports.Engine.ReportDocument
>
>myreportname = "myreport1"
>orpt = New myreportname
>
>This does not work. Is there a way??
>
>Jeff
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform