动态报表和报表字段超多的问题

xuandme000 2006-09-05 12:54:59
现在有个项目,它的所有报表的项都是动态选择的,这个是一个问题
还有一个问题就是,有时候报表多大38项,在一页纸是肯定显示不下的,于是他们要求当显示不下时,将显示不下的列另外显示,下面举个例子
如果项目有 项目1,项目2,项目3........项目30
假设A4横的只能显示 项目1-项目20,那最终的效果是

编号 项目1 项目2 项目3......项目20
1 内容1 内容2 内容3......内容20
.......

编号 项目21 项目22 项目23....项目30
1 项目内容21 项目22 项目 23 .....项目30
.......
希望用水晶报表或者sqlserver 2005 的报表,可是以前没有做过这么复杂的东西,不知道这两个工具能不能实现,当然如果能实现的化,最好能给个实现的思路
希望各位高手指点
谢谢
...全文
515 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
andylauhai 2006-10-28
  • 打赏
  • 举报
回复
Grid++Report
研究过,没研究明白,呵呵~~
yuchangmao 2006-09-14
  • 打赏
  • 举报
回复
设置你的Detail节的属性,应该是可以换行的
xuandme000 2006-09-13
  • 打赏
  • 举报
回复
我没有找到ACtivereport
各位能不能给我发一个,谢谢
xuancheng@126.com
ChinaRedRiver 2006-09-12
  • 打赏
  • 举报
回复
to yjbgwxf123:
横向打印时,在报表设计时没有问题
可是在web显示时不能完全显示
VS2003,crystal Report 10

请指教
xuandme000 2006-09-11
  • 打赏
  • 举报
回复
谢谢各位的帮忙
我也想横大,可是问题还是会有,因为有的时候项目多的不得了
yjbgwxf123 2006-09-10
  • 打赏
  • 举报
回复
没关系或,楼主可以设为横向打印的呀。
whmjw 2006-09-06
  • 打赏
  • 举报
回复
动态报表难就难在排版,下面的代码是以前做工资报表 的用的,由于工资项目是不定的,所以列也是不定的,基本上与楼主的需要差不多,但我是用ACtivereport做的,不是用水晶报表
private void constructReport()
{
this.Detail.CanGrow=true;
this.Detail.CanShrink=true;
this.Detail.KeepTogether=true;


for(int i=0;i<dt.Columns.Count;i++)
{
if(i>8 && i%9==0)
{
this.m_currentY=this.m_currentY+this.m_defaultHeight*2;
this.m_currentX=0;
count++;
}

TextBox txt=new TextBox();
txt.Location=new PointF(this.m_currentX,this.m_currentY);
this.m_currentX=this.m_currentX+this.m_defaultWidth;
txt.Width=this.m_defaultWidth;
txt.Height=this.m_defaultHeight;
txt.Border.BottomStyle=BorderLineStyle.Solid;
txt.Border.TopStyle=BorderLineStyle.Solid;
txt.Border.LeftStyle=BorderLineStyle.Solid;
txt.Border.RightStyle=BorderLineStyle.Solid;
txt.Text=dt.Columns[i].ColumnName.Trim();
txt.Alignment=TextAlignment.Center;
txt.VerticalAlignment=VerticalTextAlignment.Middle;
this.Detail.Controls.Add(txt);

}
this.m_currentX=0f;
this.m_currentY=0.2f;
for(int i=0;i<dt.Columns.Count;i++)
{
if(i>8 && i%9==0)
{
this.m_currentY=this.m_currentY+this.m_defaultHeight*2;
this.m_currentX=0;
count++;
}
TextBox txt=new TextBox();
txt.Location=new PointF(this.m_currentX,this.m_currentY);
this.m_currentX=this.m_currentX+this.m_defaultWidth;
txt.Width=this.m_defaultWidth;
txt.Height=this.m_defaultHeight;
txt.Border.BottomStyle=BorderLineStyle.Solid;
txt.Border.TopStyle=BorderLineStyle.Solid;
txt.Border.LeftStyle=BorderLineStyle.Solid;
txt.Border.RightStyle=BorderLineStyle.Solid;
txt.Alignment=TextAlignment.Center;
txt.VerticalAlignment=VerticalTextAlignment.Middle;
txt.DataField=dt.Columns[i].ColumnName;
if(dt.Columns[i].DataType.ToString()=="System.Decimal")
txt.OutputFormat="#,##0.00";
this.Detail.Controls.Add(txt);


}
TextBox txt1=new TextBox();
txt1.Location=new PointF(0f,this.m_currentY+0.2f);
this.m_currentX=this.m_currentX+this.m_defaultWidth;
txt1.Width=this.m_defaultWidth;
txt1.Height=this.m_defaultHeight;
this.Detail.Controls.Add(txt1);
this.Detail.Height=this.m_defaultHeight*count+1f;
xuandme000 2006-09-05
  • 打赏
  • 举报
回复
没有人知道吗,
真是郁闷啊
xuandme000 2006-09-05
  • 打赏
  • 举报
回复
没有人碰到过这个问题吗?
longli67 2006-09-05
  • 打赏
  • 举报
回复
这样高级的问题,不知道水晶报表10能不能搞定,最近准备学习水晶报表,关注中……
xuandme000 2006-09-05
  • 打赏
  • 举报
回复
to:Kinde()
谢谢你,可是你说的是哪一个工具?我没有见过啊
Kinde 2006-09-05
  • 打赏
  • 举报
回复
1. Use Design API dynamic create report, So can use diff field and the control the field number

2. Not use Design API, Create two report , One is for A4 other for 20-30 , Use paramater control field.

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧