Hi,
I am working with SQL Server reporting Service 2005. I have some local report(RDLC file). A small pice of code loading the reports into a page within a Report Viewer.
I want to add the paging option into that report viewer. How to do?
Here I am giving the code for report viewer.
ASPX Page:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportViewer.aspx.cs" Inherits="WebApp_ReportViewer" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="855px" SizeToReportContent="True">
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
The code os ASPX.CS page:-
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using QSNet.Engine.UI;
using QSNet.Utility;
using QSNet.Engine;
using System.Collections.Generic;
using QSNet.Engine.Model;
using QSNet.Security;
using Infragistics.WebUI.UltraWebGrid;
using QSNet.Model.Student;
using QSNet.Business.Student;
using Microsoft.Reporting.WebForms;
using System.ComponentModel;
public partial class WebApp_ReportViewer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//To Do :- calling the load report function
LoadReport();
//To Do :- getting the report data from object named as source which has been send from previous page
object source = Session["BissunessObject"];
//To Do :- display the report
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2_SP_STUD_STUDENT_Address ", source));
//ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DS_STUD_STUDENT", source));
// ReportViewer1.Page.LoadComplete;
}
private void LoadReport()
{
ReportViewer1.LocalReport.EnableExternalImages = true;
//To Do :- Getting the report name which has been send from previous page.
string strReportFileName = Request.QueryString["rptName"];
//To Do :- Display the Page title.
ReportViewer1.Page.Title = Request.QueryString["rptTitle"];
//To Do :- Load the report viewer in local mode
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("./Reports/Student/AddressLabel_Without_StudentName.rdlc");
//string Path = "./Reports/" + strReportFileName;
//ReportViewer1.LocalReport.ReportPath = Server.MapPath(Path);
LocalReport lr = ReportViewer1.LocalReport;
lr.ReportPath = Server.MapPath("./Reports/Student/AddressLabel_Without_StudentName.rdlc");
//lr.ReportPath = Server.MapPath(Path);
ReportViewer1.LocalReport.DataSources.Clear();
}
}
Now please tell me how to add the Paging for the report viewer?
My mail ID:-
csomesh@bodeninc.com
Somesh Chatterjee