Creating a DotNetNuke Private Assembly with Crystal Reports - Part 3
page 2 of 5
by Eric Landes
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24080/ 19

Displaying a Listing of Stored Reports

Download Source

Non-administrative users first see a listing of the reports available on this portal.  Using a datagrid, users see a link button and the display name of the report.  The display name shows a user friendly name (from the field ReportDispName).  We store the actual file system report name in the field ReportName.

To display this list, we use the objects created earlier in the DAL and BLL layers.  In the project source code under desktopmodules, the folder called CrystalReportManager has our project in it.  The Web User Control ReportsViewer.ascx contains the listing of reports and the viewer.  In the Page_Load event of the control, a datagrid (dg_ReportsList) is instantiated with a listing of all reports for this Portal Id.  See Code Listing 1 for the code used to call the listing of reports.

Code Listing 1

if (!IsPostBack)
{
  lblError.Text="";
  try
  {
    PortalSettings oPortal = new
PortalSettings();
    Lancor.CrystalReportManager.ReportsController
oReportConroller = new ReportsController();
    dg_ReportsList.DataSource=oReportConroller.GetReports(

    oPortal.PortalId);
    dg_ReportsList.DataBind();
  }
  catch(Exception ex)
  {
    lblError.Text= ex.Message;
  }
}

Using DotNetNuke's custom Portal Settings objects, we can get the current Portal ID to pass to the GetReports method.  Then, we bind the data from the BLL oReportController to the datagrid, in this instance named dg_ReportsList.


View Entire Article

User Comments

Title: Wrong Source code   
Name: Jesse
Date: 2006-02-07 10:41:45 AM
Comment:
The source code available here contains no more that a buggy DNN module with only a single form to store a list of files, but nothing about displaying the reports. Wrong version/ manipulation?

Product Spotlight
Product Spotlight 



Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 8:49:46 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search