Hello,
I'm trying to find a dynamic way to Generate reports. So say I have:
Report 1
Report 2
Report 3
Typically you would create a report like this in my web app.
But I hate re-writing similar pieces of code. It's bad practice repeating code.
And foreach report there everything is going to be the same except the the line where you initialize the report.
What I would like to do instead of writing a new page for each separate report is have one generic page that you send a report type to. I want to say there is some way around this using templates in C# but answer is eluding me.
I'm trying to find a dynamic way to Generate reports. So say I have:
Report 1
Report 2
Report 3
Typically you would create a report like this in my web app.
namespace
ReportingSuite.Reports
{
public
partial
class
AgentPPLReport : OLAPage
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
Ruid =
"18e1bcca-b432-47a2-90ed-f982ac6225bb"
;
if
(ValidateReport(Ruid))
{
IReportDocument r =
null
;
r =
new
AgentPPL();
ReportViewer1.Report = r;
ReportViewer1.RefreshReport();
}
}
}
}
But I hate re-writing similar pieces of code. It's bad practice repeating code.
And foreach report there everything is going to be the same except the the line where you initialize the report.
What I would like to do instead of writing a new page for each separate report is have one generic page that you send a report type to. I want to say there is some way around this using templates in C# but answer is eluding me.