一个难题(关于打印的,主要是文件的读写),在线等待.......当天结贴

lianyunzxp 2002-04-18 12:15:11
最近我做一个网上的账票打印程序,我用了一个叫FormCraft Pro的工具,它主要就是把打印的东西分为两个文件,一个就是格式文件,另一个是数据文件,数据文件在用户查询数据的时候生成,我想问的就是这个数据文件到底是应该在服务器端,还是客户端,放服务器端有一个问题,如果是多人需要打印的话,没法同时对同一个文件进行写操作.如果放客户端,不知道怎么在客户端写文件?可以写吗?最好有例子.
请各大虾帮忙,分不成问题.....可以补贴.......
Thanks....
...全文
40 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
genuis 2002-04-18
  • 打赏
  • 举报
回复
print()
可以打印当前页面
弹出一个窗口,然后执行print()
yemol_yuan 2002-04-18
  • 打赏
  • 举报
回复
既然数据文件是在用户查询时候生成的,那就可以把它保存在客户端,方法很多种了,简单的就用rds,这样不就可以了
Ngod 2002-04-18
  • 打赏
  • 举报
回复
我业正在考虑这样一个问题?
如果是在客户端放一个打印控件的话,怎样把html文件中的数据传递给控件呢?
不知用XML怎么样?有没有人来讨论一下具体的办法?
zxlkxy 2002-04-18
  • 打赏
  • 举报
回复
我也想知道,帮你UP!
xlt771111 2002-04-18
  • 打赏
  • 举报
回复
我用的cell插件,是客户端控件,还可以,代码如下
<%
if trim(cstr(request("year1")))="" then
comm="select * from clean_rcgl where year(riqi)="&year(now())&" and month(riqi)="&month(now())&" and class="&class1&" order by riqi desc"
date_str=trim(cstr(year(now())))+"年"+trim(cstr(month(now())))+"月"
else
if trim(cstr(request("month1")))="0" then
comm="select * from clean_rcgl where year(riqi)="&request("year1")&" and class="&class1&" order by riqi desc"
date_str=trim(cstr(year(now())))+"年全部"
else
comm="select * from clean_rcgl where year(riqi)="&request("year1")&" and month(riqi)="&request("month1")&" and class="&class1&" order by riqi desc"
date_str=trim(cstr(request("year1")))+"年"+trim(cstr(request("month1")))+"月"
end if
end if
'response.write "<br>"&comm
res.CursorLocation=adUseClient
res.open comm,Session("cn"),3,1
count=res.recordcount

for i=1 to count
str0=str0+trim(res("riqi"))+","
str1=str1+trim(res("text"))+","
str2=str2+trim(res("result"))+","
res.movenext
next
res.close
set res=nothing
s0=split(str0,",")
s1=split(str1,",")
s2=split(str2,",")
'response.write s(0)
%>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Sub button1_onclick
'form1.submit()
<%if count>0 then%>
'设置行数,列数
DCellWeb1.setrows <%=count+2%>,0
DCellWeb1.setcols 5,0
'设置页头,页尾字符
DCellWeb1.PrintSetHead "中信泰富物业管理" ,"<%=date_str%><%=curposition%>日常事务纪录表" ,"打印日期:<%=date()%>"
DCellWeb1.PrintSetFoot "中信泰富物业管理","<%=date_str%><%=curposition%>日常事务纪录表","打印人:<%=session("name")%>"
'第一行数据
DCellWeb1.S 1,1,"序号"
DCellWeb1.S 2,1,"日期"
DCellWeb1.S 3,1,"发生事项"
DCellWeb1.S 4,1,"处理结果"

'第一行设置为粗体
DCellWeb1.SetCellFontStyle 1,1,DCellWeb1.GetCurSheet,2
DCellWeb1.SetCellFontStyle 2,1,DCellWeb1.GetCurSheet,2
DCellWeb1.SetCellFontStyle 3,1,DCellWeb1.GetCurSheet,2
DCellWeb1.SetCellFontStyle 4,1,DCellWeb1.GetCurSheet,2

'第一行设置为居中
<%for i=1 to 4%>
<%for j=1 to count+2%>
DCellWeb1.SetCellAlign <%=i%>,<%=j%>, DCellWeb1.GetCurSheet,32+4
<%next%>
<%next%>
'DCellWeb1.SetCellAlign 2,1, DCellWeb1.GetCurSheet,32+4
'DCellWeb1.SetCellAlign 3,1, DCellWeb1.GetCurSheet,32+4
'DCellWeb1.SetCellAlign 4,1, DCellWeb1.GetCurSheet,32+4

DCellWeb1.SetCellTextColor 1,1,DCellWeb1.GetCurSheet,33

'写数据
<%for i=2 to count+2%>
DCellWeb1.SetCellTextStyle 1,<%=i%>,0,2
DCellWeb1.SetCellTextStyle 2,<%=i%>,0,2
DCellWeb1.SetCellTextStyle 3,<%=i%>,0,2
DCellWeb1.SetCellTextStyle 4,<%=i%>,0,2

DCellWeb1.S 1,<%=i%>,"<%=i-1%>"
DCellWeb1.S 2,<%=i%>,"<%=trim(s0(i-2))%>"
DCellWeb1.S 3,<%=i%>,"<%=replace(replace(trim(s1(i-2)),chr(13)," "),chr(10)," ")%>"
DCellWeb1.S 4,<%=i%>,"<%=replace(replace(trim(s2(i-2)),chr(13)," "),chr(10)," ")%>"
<%next%>

DCellWeb1.readonly=true '设为只读

'宽度
DCellWeb1.SetColWidth 1,60,1,0
DCellWeb1.SetColWidth 1,120,2,0
DCellWeb1.SetColWidth 1,235,3,0
DCellWeb1.SetColWidth 1,240,4,0

'高度
<%for i=1 to count+1%>
DCellWeb1.SetRowheight 1,DCellWeb1.GetRowBestHeight(<%=i%>),<%=i%>,0
<%next%>
DCellWeb1.Redraw
'DCellWeb1.ShowGridLine 0,DCellWeb1.GetCurSheet
DCellWeb1.DrawGridLine 1,1,5,<%=count+2%>,0,2,-1 '画表格线
DCellWeb1.PrintRange 0,0,0,0 '打印范围
DCellWeb1.PrintPara 1,1,1,1 '打印参数
DCellWeb1.PrintLabel 0,0

DCellWeb1.PrintPreview 1,DCellWeb1.GetCurSheet '预览
<%else%>
msgbox("暂无纪录!")
<%end if%>
End Sub

Sub button2_onclick
DCellWeb1.PrintSheet 1,DCellWeb1.GetCurSheet
End Sub



-->
</SCRIPT>



</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">

<OBJECT id=DCellWeb1 style="WIDTH: 691px; HEIGHT: 366px;display:none" codebase="<%=session("url")%>cellweb.cab"
classid=clsid:7C2D1122-79AC-4E11-BA88-EC07ADB86DB7 >
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="14626">
<PARAM NAME="_ExtentY" VALUE="7747">
<PARAM NAME="_StockProps" VALUE="0" ></OBJECT>
BrightEye 2002-04-18
  • 打赏
  • 举报
回复
gz!I want to know,too.
Ngod 2002-04-18
  • 打赏
  • 举报
回复
上面的兄弟,
能不能给一个例子,哪怕是很简单!只要说明问题就行!
netmailer 2002-04-18
  • 打赏
  • 举报
回复
同意二楼的
sjf331 2002-04-18
  • 打赏
  • 举报
回复
在html中一样可以传参数给控件,用脚本程序。<script language=vbscript>
</script>.我做的都是这样的。打印控件只能在客户端用。
lianyunzxp 2002-04-18
  • 打赏
  • 举报
回复
to yemol_yuan(yemol):
可以给个例子吗?
我感觉如果可以保存到客户端的话(在客户端随便写数据)
不成黑客了吗

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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