社区
图表区
帖子详情
RDLC报表新人求助
Arlingerhu
2014-08-29 10:08:19
如图
这是我用水晶报表做的考试试题选择题的样式,现在我要用rdlc报表重做,
问题是这样的样式怎么调都调不过来,刚接触rdlc,不会弄,到网上查竟然没有人
问这个问题,我这么菜?。。。。请高手赐教。
...全文
177
3
打赏
收藏
RDLC报表新人求助
如图 这是我用水晶报表做的考试试题选择题的样式,现在我要用rdlc报表重做, 问题是这样的样式怎么调都调不过来,刚接触rdlc,不会弄,到网上查竟然没有人 问这个问题,我这么菜?。。。。请高手赐教。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hong_2218529930
2014-08-31
打赏
举报
回复
绘制饼图显示全国名胜旅游投票结果 public void CreatePieImage() { //定义数据库连接字符串 string connString = System.Configuration.ConfigurationManager.AppSettings["conn"].ToString(); //建立与数据库连接的对象 SqlConnection conn = new SqlConnection(connString); //打开数据库连接 conn.Open(); //定义查询数据库的SQL语句 string cmdtxt = "select * from tb_vote"; //定义一个SqlCommand命令对象 SqlCommand comm = new SqlCommand(cmdtxt, conn); //定义一个数据集 DataSet ds = new DataSet(); //定义一个数据适配器 SqlDataAdapter da = new SqlDataAdapter(comm); //填充数据集 da.Fill(ds); conn.Close(); float Total = 0.0f, Tmp; int iLoop; for (iLoop = 0; iLoop < ds.Tables[0].Rows.Count; iLoop++) { //转换成单精度,也可以写成Convert.ToInt32 Tmp = Convert.ToSingle(ds.Tables[0].Rows[iLoop]["投票数量"]); Total += Tmp; }//CodeGo.net/ //设置字体,fontTitle为主标题的字体 Font fontLegend = new Font("verdana",9),fontTitle = new Font("verdana",10,FontStyle.Bold); //设置背景宽 int width = 250; int bufferspase = 15; int legendheight = fontLegend.Height * (ds.Tables[0].Rows.Count + 1) + bufferspase; int titleheight = fontTitle.Height+bufferspase; //设置白色背景高 int height = width + legendheight + titleheight + bufferspase; int pieheight = width; Rectangle pierect = new Rectangle(0,titleheight,width,pieheight); //加上各种随机色 ArrayList colors = new ArrayList(); //生成伪随机生成器 Random rnd = new Random(); for (iLoop = 0; iLoop < ds.Tables[0].Rows.Count; iLoop++) colors.Add(new SolidBrush(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)))); //创建一个bitmap实例 Bitmap objbitmap = new Bitmap(width,height); Graphics objgraphics = Graphics.FromImage(objbitmap); //画一个白色背景 objgraphics.FillRectangle(new SolidBrush(Color.White), 0, 0, width, height); //画一个亮黄色背景 objgraphics.FillRectangle(new SolidBrush(Color.LightYellow),pierect); //以下为画饼型图(有几行row画几个) float currentdegree = 0.0f; for(iLoop = 0; iLoop<ds.Tables[0].Rows.Count;iLoop++) { objgraphics.FillPie((SolidBrush)colors[iLoop],pierect,currentdegree, Convert.ToSingle(ds.Tables[0].Rows[iLoop]["投票数量"]) / Total * 360); currentdegree += Convert.ToSingle(ds.Tables[0].Rows[iLoop]["投票数量"]) / Total * 360; } //以下生成主标题 SolidBrush blackbrush = new SolidBrush(Color.Black); string title = "全国各地旅游名胜投票调查结果"; //封闭文本局部信息 StringFormat Format = new StringFormat(); //设置垂直面上的文本信息位置居中 Format.Alignment = StringAlignment.Center; //设置水平面上的文本信息位置居中 Format.LineAlignment = StringAlignment.Center; objgraphics.DrawString(title,fontTitle,blackbrush, new Rectangle(0,0,width,titleheight),Format); //列出各字段与得数目 objgraphics.DrawRectangle(new Pen(Color.Black, 2), 0, height - legendheight, width, legendheight); for(iLoop = 0;iLoop<ds.Tables[0].Rows.Count;iLoop++) { objgraphics.FillRectangle((SolidBrush)colors[iLoop],5,height - legendheight + fontLegend.Height * iLoop+5,10,10); //读出数据库中的“旅游目的地”、“投票数量”信息 objgraphics.DrawString(((String)ds.Tables[0].Rows[iLoop]["图书名称"]) +"(" +(ds.Tables[0].Rows[iLoop]["投票数量"])+"票"+")"+ "——" + Convert.ToString(Convert.ToSingle(ds.Tables[0].Rows[iLoop]["投票数量"]) * 100 /Total).Substring(0, 5) + "%", fontLegend, blackbrush, 20, height - legendheight + fontLegend.Height * iLoop + 1); } //图像总的高度-一行字体的高度,即是最底行的一行字体高度(height - fontLegend.Height ) objgraphics.DrawString("风景观光投票总数是:" + Convert.ToString(Total), fontLegend, blackbrush, 5, height - fontLegend.Height); //输出图片格式为gif Response.ContentType = "image/gif"; objbitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); objgraphics.Dispose(); objbitmap.Dispose(); }
Arlingerhu
2014-08-29
打赏
举报
回复
靠 自己顶
wangnaisheng
2014-08-29
打赏
举报
回复
http://blog.csdn.net/keisuoy/article/details/1731528
http://www.cnblogs.com/SkySoot/archive/2011/11/24/2261952.html
参考这个,你的类似。
客户端必须安装的
rdlc
报表
运行插件
winform程序客户端必须安装的
rdlc
报表
运行插件,里面有从vs2005到vs2013的版本
RDLC
报表
绑定到数据集的简单使用.zip
使用
RDLC
报表
简单显示虚拟人物的消费
报表
。
C#
rdlc
报表
嵌套子
报表
winform中使用
rdlc
报表
,
rdlc
报表
的显示
rdlc
报表
子
报表
的显示
RDLC
报表
设计器
针对
rdlc
报表
C#
报表
设计 独立于程序之外,让客户自己进行
报表
打印位置,保留位数,数据格式等DIY设计与制作。
Rdlc
报表
设计器,设计ReportViewer
报表
必备利器
Rdlc
报表
设计器,设计ReportViewer
报表
必备利器,自动生成
rdlc
报表
文件,动态自定义列,很巴适的哦!
图表区
4,819
社区成员
14,134
社区内容
发帖
与我相关
我的任务
图表区
.NET技术 图表区
复制链接
扫一扫
分享
社区描述
.NET技术 图表区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章