Hey manujusha,
In the scenario I described, there really isn't much functionality that DNN is responsible for, its more just using DNN as a wrapper to easily include the report in your DNN site, and potentially use in different portals or sites.
Check out this page for more information on the report viewer: http://gotreportviewer.com
This page also provides a resource for obtaining the report viewer: http://www.codeproject.com/KB/reporting-services/Reporting_Services.aspx
I will provide a sample to show you a very simple use case scenario:
This is the ASCX file:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="BillingReport.ascx.vb" Inherits=".BillingReport" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register TagPrefix="cc1" Namespace="Microsoft.Samples.ReportingServices" Assembly="ReportViewer" %>
<p>
Begin Date: <asp:TextBox ID="TextBoxBeginDate" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidatorBeginDate" runat="server" ErrorMessage="Please enter a begin date." Text="*" ValidationGroup="ValidationGroupBilling" Display="Dynamic" ControlToValidate="TextBoxBeginDate"></asp:RequiredFieldValidator><br />
End Date: <asp:TextBox ID="TextBoxEndDate" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidatorEndDate" runat="server" ErrorMessage="Please enter an end date." Text="*" ValidationGroup="ValidationGroupBilling" Display="Dynamic" ControlToValidate="TextBoxEndDate"></asp:RequiredFieldValidator>
</p>
<p><asp:Button ID="ButtonSubmit" runat="server" Text="Submit" ValidationGroup="ValidationGroupBilling" /></p>
<cc2:CalendarExtender ID="CalendarExtenderBeginDate" runat="server" TargetControlID="TextBoxBeginDate"></cc2:CalendarExtender>
<cc2:CalendarExtender ID="CalendarExtenderEndDate" runat="server" TargetControlID="TextBoxEndDate"></cc2:CalendarExtender>
<cc1:reportviewer id="ReportViewerBilling" runat="server" ServerUrl="http://xxxxxxx/ReportServer/" ReportPath="/XXXXXXXXReports/rptBilling" Height="640px" Width="1000px"></cc1:reportviewer>
This is the ASCX.VB file:
Imports DotNetNuke
Partial Public Class BillingReport
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Try
'register script manager
DotNetNuke.Framework.AJAX.RegisterScriptManager()
'default to the last week
CreateReport(DateTime.Now.AddDays(-7).ToShortDateString(), DateTime.Now.ToShortDateString())
Catch ex As Exception
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(Me, ex)
End Try
End If
End Sub
Protected Sub ButtonSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSubmit.Click
If Page.IsValid Then CreateReport(TextBoxBeginDate.Text, TextBoxEndDate.Text)
End Sub
Private Sub CreateReport(ByVal beginDate As String, ByVal endDate As String)
ReportViewerBilling.Parameters = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False
ReportViewerBilling.SetQueryParameter("BeginDate", beginDate)
ReportViewerBilling.SetQueryParameter("EndDate", endDate)
'get current portal id
ReportViewerBilling.SetQueryParameter("PortalID", PortalId.ToString())
End Sub
End Class
Take care,
Ian