
正文
vb.net报表分组分页 vb分组控件
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net的 分页处理
两个方案,一,是通过控件来控制分页,就是先将数据全部读到缓存中,然后利用控件的每页显示数量以及下一页,上一页的跳转按钮控制。二,是利用数据库中的存储过程来实现,在存储过程中已经写好分页代码,每次读取的时候都只读取一定数量的信息!!
相关问答
Q1: vb.net listview 分页
用pageDataSource类
与DataSource用法差不多
由于DataList本身没有带分页功能vb.net报表分组分页,pageDateSource祢补vb.net报表分组分页了这个不足,你可以当作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(); // vb.net报表分组分页我写的数据库操作方法集,创建一个实例
Operation MyOperation = new Operation(); // vb.net报表分组分页我写的网站通用处理方法集,创建一个实例
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(); // 总页数
}
}
Q2: 请问vb.net怎么查询出ACCESS数据库的记录并能分页显示?
当然能,把你不分页的程序贴出来,我给你修改嘛。
主要就是利用rs.PageSize等实现,在你程序的下面语句:
rs.open sqlc,conn,1,1
之后,添加下面的代码可以控制显示的记录范围:
rs.PageSize = 10 'pagesize属性指定了每页要显示的记录条数
rs.AbsolutePage = Page '把页码赋给absolutepage属性从而知当前页的首条记录号
上的PAGE是调用是带过来的参数,没有参数时指定为1,表示显示第一页。
Q3: 报表中怎么设置分组分页合计
本文就来解决不写一行代码就能在区域报表,页面/RDL 报表中实现分页合计的功能:
1. 区域报表
关键点: 区域报表中TextBox属性SummaryType 设置为PageTotal;
2. RDL 报表
关键点: 使用ReportItems!TextBoxName.Value 进行合计;
具体的实现步骤,请参考下面的博客
Q4: vb.net入门之分组控件:GroupBox控件
我们对控件进行分组vb.net报表分组分页的原因不外乎三个
为vb.net报表分组分页了获得清晰vb.net报表分组分页的用户界面而将相关vb.net报表分组分页的窗体元素进行可视化分组
编程分组 如对单选按钮进行分组
为vb.net报表分组分页了在设计时将多个控件作为一个单元来移动
在中 有GroupBox Panel TabControl这三个控件可以实现上面所提到的三个分组目的 所以我们称它们为分组控件
这三个控件在功用上十分的相似 特别是GroupBox和Panel控件 只存在一点细微的差别而已(这个差别是 只有GroupBox控件可以显示标题 而只有Panel控件可以有滚动条) 这里我们就先来了解GroupBox控件的使用
GroupBox(控件组)控件一般是作为其他控件的组的容器的形式存在的 这样有利于用户识别 使界面变得更加友好(GroupBox控件相当于Visual Basic以前版本的Frame控件) 使用控件组控件可以将一个窗体中的各种功能进一步进行分类 例如 将各种选项按钮控件分隔开
当移动单个GroupBox控件时 它所包含的所有控件也将一起移动
在大多数情况下 对控件组控件没有实际的操作 我们用它对控件进行分组 通常没有必要响应它的事件 不过 它的Name Text和Font等属性可能会经常被修改 以适应应用程序在不同阶段的要求
GroupBox控件在工具箱中的图标如图所示
一 GroupBox控件的常用属性
Anchor和Dock 这两个属性是所有有用户界面的控件都有的定位属性 这里就不啰嗦了
Name属性 标识控件的对象名称
Text属性 显示在GroupBox控件右上方的标题文字 可以用来标识该控件组的描述
Font和ForeColor属性 用于改变GroupBox控件的文字大小以及文字的颜色 需要注意的时候 它不单改变GroupBox控件的Text属性的文字外观 同时也改变其内部控件的显示的Text属性的文字外观
二 创建一组控件
在窗体上放置GroupBox控件 从工具箱中拖放一个GroupBox控件到窗体上的合适位置 调整大小
在属性窗口中改变GroupBox控件的Text属性 作为它的标题
在GroupBox控件内拖放其它需要的控件 例如RadioButton控件
设置示例 如图一所示
图一 用控件组控件对单选按钮分组
我们在拖动单个GroupBox控件的时候 它内部的控件也会随着移动 以保持和GroupBox的相对位置不变 同理 删除GroupBox控件时 它所包含的所有控件也会被删除掉
当我们调整GroupBox控件所包含的控件的Anchor和Dock属性的时候 其参照物将不是Form窗体 而是GroupBox控件了
三 编程添加GroupBox控件以及它所包含的控件
虽然GroupBox控件是在设计时用视图设计布局效果最好 但是无可避免地 很多特殊情况下也是需要在运行做添加控件到控件组中的 这里我们就用代码来完成上图一界面的绘制
动态添加控件一般需要经过下面三个步骤
创建要添加的控件实例
设置新控件的属性
将控件添加到父控件的 Controls 集合
在Form 代码的任意位置增加初始化控件的过程InitializeControl() 代码如下所示
Sub InitializeControl()
首先添加Label和TextBox控件
Dim Label As New System Windows Forms Label
Dim TextBox As New System Windows Forms TextBox
Label
Label Location = New System Drawing Point( )
Label Name = Label
Label Size = New System Drawing Size( )
Label TabIndex =
Label Text = 户主姓名
TextBox
TextBox Location = New System Drawing Point( )
TextBox Name = TextBox
TextBox Size = New System Drawing Size( )
TextBox TabIndex =
TextBox Text =
把它们添加到父控件Form 的Controls集合中
Me Controls Add(TextBox )
Me Controls Add(Label )
添加三个GroupBox控件
Dim GroupBox As New System Windows Forms GroupBox
Dim GroupBox As New System Windows Forms GroupBox
Dim GroupBox As New System Windows Forms GroupBox
GroupBox
GroupBox BackColor = System Drawing SystemColors Control
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 性别
GroupBox
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 单元
GroupBox
GroupBox Location = New System Drawing Point( )
GroupBox Name = GroupBox
GroupBox Size = New System Drawing Size( )
GroupBox TabIndex =
GroupBox TabStop = False
GroupBox Text = 楼层
把它们添加到父控件Form 的Controls集合中
Me Controls Add(GroupBox )
Me Controls Add(GroupBox )
Me Controls Add(GroupBox )
添加RadioButton控件并分别绘制在GroupBox控件内
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
Dim RadioButton As New System Windows Forms RadioButton
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 男性
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 女性
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 二单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 三单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 一单元
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四单元
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 二楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 三楼
RadioButton
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 一楼
RadioButton
RadioButton BackColor = System Drawing SystemColors Control
RadioButton Location = New System Drawing Point( )
RadioButton Name = RadioButton
RadioButton Size = New System Drawing Size( )
RadioButton TabIndex =
RadioButton Text = 四楼
分别把它们添加到父控件GroupBox的Controls集合中
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
GroupBox Controls Add(RadioButton )
End Sub
把上一页的代码复制添加后 把控件初始化过程InitializeControl()过程添加到Form 的New构造函数中 如下图二所示
图二 在New构造函数中添加过程InitializeControl()
现在按F 运行 Form 的窗体控件布局(如下图三所示)是不是和我们手工布局的图一的布局是一样的呢?
lishixinzhi/Article/program/ASP/201311/21749
Q5: vb.net 打印预览分页
病情分析:
您好,你经常头晕估计是与血压偏低是有关系的。
指导意见:
你可以吃点蜂王浆或生脉饮调理,平时要积极参加体育锻炼,改善体质,增加营养,多喝水,多吃汤。
病情分析:
你好,你的情况属于低血压引起的症状,一般会引起经常头晕乏力和眼花等症状,你的情况需要积极治疗的的
指导意见:
你的情况我建议首先就要注意休息,清淡温热易消化饮食很关键的,建议你用人参炖鸡汤服用看看,多吃红枣和枸杞等食物,积极参加体育锻炼,祝你健康
病情分析:
你好!根据你的资料初步考虑,你的头晕和你的血压偏低相关。血压偏低时改变体位会导致的一过性脑供血不足,其临床特点是头晕,睡眠障碍,记忆力减退三大症状,还有顶枕部头痛,轻瘫,言语障碍、情绪易激动等表现,一般病情缓慢发展,此类头晕的特点是在体位转变时容易出现或加重,如由平卧突然坐起,或者是下蹲后突然站立等动作。头晕可分为两类:一为旋转性眩晕,多由前庭神经系统及小脑的功能障碍所致,以倾倒的感觉为主,感到自身晃动或景物旋转。二为一般性晕,多由某些全身性疾病引起,以头昏的感觉为主,感到头重脚轻。如贫血、体质衰竭等。
指导意见:
建议做全身体检,测血压,血糖,血常规,做头颅、颈椎CT等,寻找原因,对症治疗。避免劳累,减轻心理负担,积极配合治疗,增强免疫力。祝你健康!
头晕可能是感冒,颈椎病,贫血,美尼尔氏综合征,心律失常,休息的时间和质量不好,都是可能导致的,需要找到原因,针对性的治疗才行。
头晕可能是感冒,颈椎病,贫血,美尼尔氏综合征,心律失常,休息的时间和质量不好,都是可能导致的,需要找到原因,针对性的治疗
你好,血压只是低些而没有不适症状一般不需要处理,如果感到不适或伴有其他症状就医治疗了,建议服用生脉饮口服液或者脑心舒口服液治疗.希望回答可以对您有帮助
可能是感冒,贫血,美尼尔氏综合征,心律失常,休息的时间和质量不好,都是可能导致的,需要找到原因,针对性的治疗。
头晕原因很多,一般有颈椎病,贫血,美尼尔氏综合征,心律失常,,腔隙性脑梗塞等,建议你去医院检查,确诊病因才能有效治疗。
您好,头晕还要结合一下血脂等情况,根据具体原因采取治疗措施,
vb.net报表分组分页的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb分组控件、vb.net报表分组分页的信息别忘了在本站进行查找喔。







