FastReport 怎么应用于C#.NET~?急!
最好有示例的那种,关键是这两个环境怎么结合起来啊``??怎么在c#.net中应用FastReport??我用的是VS2005应该安装哪一个版本的FastReport??我...
最好有示例的那种,关键是这两个环境怎么结合起来啊``??怎么在c#.net中应用FastReport??我用的是VS2005应该安装哪一个版本的FastReport??我的QQ:287476575
展开
2个回答
展开全部
<body MS_POSITIONING="GridLayout">
<OBJECT id=report1
codeBase="<%=HTTPStr%>/common/ocx/ReportActiveFormProj1.ocx#version=2,0,0,0"
height=830 hspace=0 width="100%" align=center vspace=0
classid=clsid:B9BE2CBF-747A-49E5-AD52-9D983D9536E8 VIEWASTEXT>
<PARAM NAME="Visible" VALUE="0">
<PARAM NAME="AutoScroll" VALUE="0">
<PARAM NAME="AutoSize" VALUE="0">
<PARAM NAME="AxBorderStyle" VALUE="1">
<PARAM NAME="Caption" VALUE="ReportActiveFormX">
<PARAM NAME="Color" VALUE="2147483663">
<PARAM NAME="Font" VALUE="宋体">
<PARAM NAME="KeyPreview" VALUE="0">
<PARAM NAME="PixelsPerInch" VALUE="96">
<PARAM NAME="PrintScale" VALUE="1">
<PARAM NAME="Scaled" VALUE="-1">
<PARAM NAME="DropTarget" VALUE="0">
<PARAM NAME="HelpFile" VALUE="">
<PARAM NAME="DoubleBuffered" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="Cursor" VALUE="0">
<PARAM NAME="HelpType" VALUE="0">
<PARAM NAME="HelpKeyword" VALUE="">
<PARAM NAME="ColNum" VALUE="0">
<PARAM NAME="ExportFileName" VALUE="">
</OBJECT>
<script>
report1.SetfrfFilePath('<%= modelPath %>')
<%=mm%>
report1.ShowReport();
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
</form>
</body>
这是打印界面代码
---------------------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
string modelPath_host = Request.ServerVariables["LOCAL_ADDR"];
HTTPStr = "http://" + modelPath_host;
modelPath = "http://"+modelPath_host+"/common/ocx/rpfile/query_errorpinyin_report.txt";//指到模板的网站路径
Brjl.BcMis.Common.Query.ErrorPy query = (Brjl.BcMis.Common.Query.ErrorPy)Session["Query_Error_Pinyin"];//获取查询参数
using(DataSet ds = new Brjl.BcMis.Bussiness.Queries.ErrorPy().GetErrorCode(query)//查询后的数据集
{
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
int num = i+1;
mm=mm+"report1.AddMultiData(\"data1\",\""+num.ToString()+"\");\n";
mm=mm+"report1.AddMultiData(\"data2\",\""+ds.Tables[0].Rows[i]["jc"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data3\",\""+ds.Tables[0].Rows[i]["neeaid"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data4\",\""+ds.Tables[0].Rows[i]["cname"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data5\",\""+ds.Tables[0].Rows[i]["pinyin"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data6\",\""+ds.Tables[0].Rows[i]["aa"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data7\",\""+ds.Tables[0].Rows[i]["name"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data8\",\""+ds.Tables[0].Rows[i]["phone"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data9\",\""+ds.Tables[0].Rows[i]["mobile"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data10\",\""+ds.Tables[0].Rows[i]["email"].ToString().Replace("\r\n"," ")+"\");\n";
mm=mm+"report1.AddMultiData(\"data11\",\""+ds.Tables[0].Rows[i]["address"].ToString().Replace("\r\n"," ")+"\");\n";
}
mm="report1.BindMultiDataTofrBind('data1,data2,data3,data4,data5,data6,data7,data8,data9,data10,data11','mm');\n"+mm;//循环后赋给mm 字符串,这些data 就是你模板上的控件id
}
}
后台代码----------------------------------------------------------------
应该还有简单的方法,一条sql语句就行了,在找找
-----------------------------------------------------------------------
上班是以前的版本,要是用最新的就是只要sql语句
<script language="javascript">
{
report1.SetReportFile("<%=modelPath%>");
report1.SetQuerySql("ADOQuery1","<%=sql%>");
report1.ShowReport();
}
</script>
<OBJECT id=report1
codeBase="<%=HTTPStr%>/common/ocx/ReportActiveFormProj1.ocx#version=2,0,0,0"
height=830 hspace=0 width="100%" align=center vspace=0
classid=clsid:B9BE2CBF-747A-49E5-AD52-9D983D9536E8 VIEWASTEXT>
<PARAM NAME="Visible" VALUE="0">
<PARAM NAME="AutoScroll" VALUE="0">
<PARAM NAME="AutoSize" VALUE="0">
<PARAM NAME="AxBorderStyle" VALUE="1">
<PARAM NAME="Caption" VALUE="ReportActiveFormX">
<PARAM NAME="Color" VALUE="2147483663">
<PARAM NAME="Font" VALUE="宋体">
<PARAM NAME="KeyPreview" VALUE="0">
<PARAM NAME="PixelsPerInch" VALUE="96">
<PARAM NAME="PrintScale" VALUE="1">
<PARAM NAME="Scaled" VALUE="-1">
<PARAM NAME="DropTarget" VALUE="0">
<PARAM NAME="HelpFile" VALUE="">
<PARAM NAME="DoubleBuffered" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="Cursor" VALUE="0">
<PARAM NAME="HelpType" VALUE="0">
<PARAM NAME="HelpKeyword" VALUE="">
<PARAM NAME="ColNum" VALUE="0">
<PARAM NAME="ExportFileName" VALUE="">
</OBJECT>
<script>
report1.SetfrfFilePath('<%= modelPath %>')
<%=mm%>
report1.ShowReport();
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
</form>
</body>
这是打印界面代码
---------------------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
string modelPath_host = Request.ServerVariables["LOCAL_ADDR"];
HTTPStr = "http://" + modelPath_host;
modelPath = "http://"+modelPath_host+"/common/ocx/rpfile/query_errorpinyin_report.txt";//指到模板的网站路径
Brjl.BcMis.Common.Query.ErrorPy query = (Brjl.BcMis.Common.Query.ErrorPy)Session["Query_Error_Pinyin"];//获取查询参数
using(DataSet ds = new Brjl.BcMis.Bussiness.Queries.ErrorPy().GetErrorCode(query)//查询后的数据集
{
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
int num = i+1;
mm=mm+"report1.AddMultiData(\"data1\",\""+num.ToString()+"\");\n";
mm=mm+"report1.AddMultiData(\"data2\",\""+ds.Tables[0].Rows[i]["jc"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data3\",\""+ds.Tables[0].Rows[i]["neeaid"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data4\",\""+ds.Tables[0].Rows[i]["cname"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data5\",\""+ds.Tables[0].Rows[i]["pinyin"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data6\",\""+ds.Tables[0].Rows[i]["aa"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data7\",\""+ds.Tables[0].Rows[i]["name"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data8\",\""+ds.Tables[0].Rows[i]["phone"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data9\",\""+ds.Tables[0].Rows[i]["mobile"]+"\");\n";
mm=mm+"report1.AddMultiData(\"data10\",\""+ds.Tables[0].Rows[i]["email"].ToString().Replace("\r\n"," ")+"\");\n";
mm=mm+"report1.AddMultiData(\"data11\",\""+ds.Tables[0].Rows[i]["address"].ToString().Replace("\r\n"," ")+"\");\n";
}
mm="report1.BindMultiDataTofrBind('data1,data2,data3,data4,data5,data6,data7,data8,data9,data10,data11','mm');\n"+mm;//循环后赋给mm 字符串,这些data 就是你模板上的控件id
}
}
后台代码----------------------------------------------------------------
应该还有简单的方法,一条sql语句就行了,在找找
-----------------------------------------------------------------------
上班是以前的版本,要是用最新的就是只要sql语句
<script language="javascript">
{
report1.SetReportFile("<%=modelPath%>");
report1.SetQuerySql("ADOQuery1","<%=sql%>");
report1.ShowReport();
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询