vb点虐 报表分组分页 vba分类

vb点虐 的 分页处理

两个方案,一,是通过控件来控制分页,就是先将数据全部读到缓存中,然后利用控件的每页显示数量以及下一页,上一页的跳转按钮控制。二,是利用数据库中的存储过程来实现,在存储过程中已经写好分页代码,每次读取的时候都只读取一定数量的信息!!

创新互联主营新县网站建设的网络公司,主营网站建设方案,App定制开发,新县h5成都小程序开发搭建,新县网站营销推广欢迎新县等地区企业咨询

报表中怎么设置分组分页合计

本文就来解决不写一行代码就能在区域报表,页面/RDL 报表中实现分页合计的功能:

1. 区域报表

关键点: 区域报表中TextBox属性SummaryType 设置为PageTotal;

2. RDL 报表

关键点: 使用ReportItems!TextBoxName.Value 进行合计;

具体的实现步骤,请参考下面的博客

vb点虐 listview 分页

用pageDataSource类

与DataSource用法差不多

由于DataList本身没有带分页功能,pageDateSource祢补了这个不足,你可以当作DateSource来使用,没有太大区别

using System;

using System.Data;

using System.Configuration;

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 System.Text.RegularExpressions;

public partial class _Default : System.Web.UI.Page

{

SqlHelper MySqlHelper = new SqlHelper(); // 我写的数据库操作方法集,创建一个实例

Operation MyOperation = new Operation(); // 我写的网站通用处理方法集,创建一个实例

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

GbookData();

lb_count.Text = MySqlHelper.MyScalar("SELECT COUNT(*) FROM BBS WHERE BBS_IsDisplay = '1'"); // 记录条数

}

}

protected void GbookData() // 分页程序代码

{

string strURL = Request.RawUrl;

int intPage = 1;

PagedDataSource MyPager = new PagedDataSource();

MyPager.DataSource = MySqlHelper.MyDS("SELECT * FROM BBS WHERE BBS_IsDisplay = '1' ORDER BY BBS_ID DESC").Tables["MyTable"].DefaultView;

MyPager.PageSize = 9;

MyPager.AllowPaging = true;

hpl_first.Enabled = true;

hpl_up.Enabled = true;

hpl_down.Enabled = true;

hpl_end.Enabled = true;

if (strURL.Contains("/Page/"))

{

string strPage = strURL.Substring(strURL.LastIndexOf("/Page/") + 6);

if (strURL.Substring(strURL.LastIndexOf("/")) == "/")

{

Response.Redirect("NoAccess.htm");

}

if (Regex.IsMatch(strPage, "\\d"))

{

int thisPage;

try

{

thisPage = Convert.ToInt32(strURL.Substring(strURL.LastIndexOf("/Page/") + 6));

if (thisPage 1 || thisPage MyPager.PageCount)

{

Response.Redirect("NoAccess.htm");

}

else

{

intPage = thisPage;

}

}

catch

{

Response.Redirect("NoAccess.htm");

}

}

else

{

Response.Redirect("NoAccess.htm");

}

}

hpl_first.NavigateUrl = "~/GuestBook/Page/1";

hpl_up.NavigateUrl = "~/GuestBook/Page/" + (intPage - 1).ToString();

hpl_down.NavigateUrl = "~/GuestBook/Page/" + (intPage + 1).ToString();

hpl_end.NavigateUrl = "~/GuestBook/Page/" + MyPager.PageCount;

MyPager.CurrentPageIndex = intPage - 1;

Repeater_1.DataSource = MyPager;

Repeater_1.DataBind();

if (MyPager.IsFirstPage)

{

hpl_first.Enabled = false;

hpl_up.Enabled = false;

}

if (MyPager.IsLastPage)

{

hpl_down.Enabled = false;

hpl_end.Enabled = false;

}

lb_thispage.Text = intPage.ToString(); // 当前页码

lb_totalpage.Text = MyPager.PageCount.ToString(); // 总页数

}

}

网站名称:vb点虐 报表分组分页 vba分类
URL分享:https://www.cdcxhl.com/article12/ddsoggc.html

成都网站建设公司_创新互联,为您提供Google网站营销网页设计公司网站制作电子商务移动网站建设

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

商城网站建设