Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»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>

Have a Question and dont know the answer post it below and get answers in minutes

Due to spam this feature is disabled
To get answers fast , make sure you enter a detailed subject for example: "DataGrid issues need answer" not "DataGrid"

Subject:

Catjegory Name:

Message:



© 2008 dotnetwatch.com -- Privacy policy