Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report name as variable?
Message
From
23/06/2004 12:10:08
 
 
To
23/06/2004 09:46:32
General information
Forum:
ASP.NET
Category:
Reporting
Miscellaneous
Thread ID:
00916127
Message ID:
00916469
Views:
7
Just as a follow-up, the load function isn't necessary, depending on how the report is being generated. With a strongly-typed report, you can instantiate it by the class name and then set the preview window's reportsource to the report object, like so...

RPT_MyReport oReport = new RPT_MyReport();
oReport.Database.Tables[0].SetDataSource(MyReportTable);
myViewer.ReportSource = oReport;

In that case, the report gets compiled into the app (which can be a benefit or drawback, depending on the situation).

So in that instance, yes, reflection would be the only way if you wanted to handle the name dynamically. From the lines of code that were posted, that was the direction I thought he was headed.

But if you're using other methods, (untyped, report was created outside of .NET), then the report name/path can be handled by the code in his follow-up post.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform