»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
assebly example<code>
Type ObjType = null;
Reprt oRpt = new Reprt();
try
{
Assembly ass = null;
ass = Assembly.Load("dllname"); //no.dll
if (ass != null)
{
ObjType = ass.GetType(dllname." + rptDetails.FileName.Replace(".rpx", string.Empty));
if (ObjType != null)
{
object[] ReportParameters;
//ViewState["backDays"]
ReportParameters = new object[]{backDays,rptDetails.ImagePath};
oRpt = ((CommAdminReport)(Activator.CreateInstance(ObjType, ReportParameters)));
oRpt.ConnectionString = ""; //rptDetails.ConnectionString;
oRpt.ReportName = rptDetails.Name ;//this.rptName;
oRpt.ReportFileName = rptDetails.FileName;
oRpt.Run(false);
// Instantiate a PDF export object
PdfExport pdf = new PdfExport();
// Export report to a PDF document and save to disk
pdf.Export(oRpt.Document, Application.StartupPath + @"\Reports\" + rptDetails.FileName.Replace("rpt", string.Empty).Replace(".rpx", ".pdf"));
// Calls PDF Viewer with report filename
//Process.Start(Application.StartupPath + @"\Reports\" + rptDetails.FileName.Replace("rpt", string.Empty).Replace(".rpx", ".pdf"));
}
}
</code>
|