關於ActiveReport2.0

paradise885 2004-09-21 10:18:03

1、在ActiveReport2.0中怎樣生成*.rpx報表模板文件,它好象沒有水晶報表哀9.0那樣的設計器是嗎,那怎樣生成*.rpx文件?
2、在VB中怎樣調用*.rpx的模板文件,謝謝!
大俠有空請寄一例到newparadise@sina.com,謝謝!
...全文
210 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
axer 2004-09-26
  • 打赏
  • 举报
回复
3、至于rpx文件,你可以用记事本新建一个空的文本文件,改名,存为fmt01.rpx,放到你刚保存的vb工程目录下面,粘如下代码:
<?xml version="1.0" encoding="UTF-8" ?>
<ActiveReportsLayout
GUIDLIB="{00000000-0000-0000-0000-000000000000}" GUIDREP="{00000000-0000-0000-0000-000000000000}"
LICENSE="10000000"
PrintWidth="9780"
DocumentName="ActiveReports Document"
ScriptLang="VBScript"
>
<Watermark
>
</Watermark>
<PageSettings>
</PageSettings>
<StyleSheet>
<Style Name="Normal"
Value="font-family: 'Arial'; font-style: normal; font-variant: inherit; font-weight: normal; font-size: 10pt; font-size-adjust: inherit; font-stretch: inherit; color: rgb(0,0,0); background-color: rgb(255,255,255); background-image: inherit; background-repeat: inherit; background-attachment: inherit; background-x-position: inherit; background-y-position: inherit; opacity: inherit; word-spacing: inherit; letter-spacing: inherit; text-decoration: none; vertical-align: inherit; text-transform: inherit; text-align: inherit; text-indent: inherit; unicode-bidi: inherit; line-height: inherit; white-space: inherit; ddo-can-grow: inherit; ddo-can-shrink: inherit; ddo-char-set: 0; "
/>
<Style Name="Heading1"
Value="font-family: 'inherit'; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 16pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading2"
Value="font-family: 'Times New Roman'; font-style: italic; font-variant: inherit; font-weight: bold; font-size: 14pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading3"
Value="font-family: 'inherit'; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 13pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading4"
/>
</StyleSheet>
<Sections>
<Section Type="PageHeader" Name="标题"
Height="0"
>
</Section>
<Section Type="Detail" Name="内容"
Height="2280"
>
<Control
Type="AR.Label"
Name="tsuser"
Left="850"
Top="709"
Width="1134"
Height="283"
Caption="label1111"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 14pt; color: rgb(0,0,255); "
>
</Control>
<Control
Type="AR.Label"
Name="tstel"
Left="850"
Top="1276"
Width="2552"
Height="283"
Caption="test2"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 14pt; color: rgb(0,0,255); "
>
</Control>
<Control
Type="AR.Label"
Name="truser"
Left="3827"
Top="709"
Width="2126"
Height="283"
Caption="label 2"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 14pt; color: rgb(0,0,255); text-align: left; "
>
</Control>
<Control
Type="AR.Label"
Name="trtel"
Left="3969"
Top="1417"
Width="1842"
Height="284"
Caption="df北京gfgd"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 12pt; color: rgb(0,0,255); "
>
</Control>
</Section>
<Section Type="PageFooter" Name="尾注"
Height="0"
>
</Section>
</Sections>
</ActiveReportsLayout>

fmt02.rpx 同样,粘如下代码:
<?xml version="1.0" encoding="UTF-8" ?>
<ActiveReportsLayout
GUIDLIB="{00000000-0000-0000-0000-000000000000}" GUIDREP="{00000000-0000-0000-0000-000000000000}"
LICENSE="10000000"
PrintWidth="9780"
DocumentName="ActiveReports Document"
ScriptLang="VBScript"
>
<Watermark
>
</Watermark>
<PageSettings>
</PageSettings>
<StyleSheet>
<Style Name="Normal"
Value="font-family: 'Arial'; font-style: normal; font-variant: inherit; font-weight: normal; font-size: 10pt; font-size-adjust: inherit; font-stretch: inherit; color: rgb(0,0,0); background-color: rgb(255,255,255); background-image: inherit; background-repeat: inherit; background-attachment: inherit; background-x-position: inherit; background-y-position: inherit; opacity: inherit; word-spacing: inherit; letter-spacing: inherit; text-decoration: none; vertical-align: inherit; text-transform: inherit; text-align: inherit; text-indent: inherit; unicode-bidi: inherit; line-height: inherit; white-space: inherit; ddo-can-grow: inherit; ddo-can-shrink: inherit; ddo-char-set: 0; "
/>
<Style Name="Heading1"
Value="font-family: 'inherit'; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 16pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading2"
Value="font-family: 'Times New Roman'; font-style: italic; font-variant: inherit; font-weight: bold; font-size: 14pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading3"
Value="font-family: 'inherit'; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 13pt; font-size-adjust: inherit; font-stretch: inherit; "
/>
<Style Name="Heading4"
/>
</StyleSheet>
<Sections>
<Section Type="PageHeader" Name="标题"
Height="0"
>
</Section>
<Section Type="Detail" Name="内容"
Height="2280"
>
<Control
Type="AR.Label"
Name="tsuser"
Left="850"
Top="709"
Width="1134"
Height="283"
Caption="label1"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 12pt; color: rgb(0,0,255); "
>
</Control>
<Control
Type="AR.Label"
Name="tstel"
Left="850"
Top="1276"
Width="2552"
Height="283"
Caption="wd2352wrwf"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 12pt; color: rgb(0,0,255); "
>
</Control>
<Control
Type="AR.Label"
Name="truser"
Left="3827"
Top="709"
Width="2126"
Height="283"
Caption="label 2"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 12pt; color: rgb(0,0,255); text-align: left; "
>
</Control>
<Control
Type="AR.Label"
Name="trtel"
Left="3969"
Top="1417"
Width="1842"
Height="284"
Caption="dffgdgdgfgd"
ClassName="Normal"
Style="font-family: '宋体'; font-size: 12pt; color: rgb(0,0,255); "
>
</Control>
</Section>
<Section Type="PageFooter" Name="尾注"
Height="0"
>
</Section>
</Sections>
</ActiveReportsLayout>

就可以了。
axer 2004-09-26
  • 打赏
  • 举报
回复
很简单的,步骤如下:
1、新建vb工程,部件里选取arp的那个runtime designer,保存工程;不要更改form1的默认名称;
2、在form1上放3个command button,也不要改默认名字;
、用记事本打开form1.frm,把下面代码粘进去:
VERSION 5.00
Object = "{E281C260-6F27-11D1-8AF0-00A0C98CD92B}#2.0#0"; "ardespro2.dll"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7065
ClientLeft = 60
ClientTop = 345
ClientWidth = 9180
LinkTopic = "Form1"
ScaleHeight = 7065
ScaleWidth = 9180
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "Close"
Height = 375
Left = 2640
TabIndex = 2
Top = 120
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "Load Rpx2"
Height = 375
Left = 1320
TabIndex = 1
Top = 120
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "Load Rpx1"
Height = 375
Left = 0
TabIndex = 0
Top = 120
Width = 1335
End
Begin DDActiveReportsDesignerCtl.ARDesigner ARD
Height = 8415
Left = 0
TabIndex = 3
Top = 600
Width = 8655
_ExtentX = 15266
_ExtentY = 14843
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub Command1_Click()
Dim rpt As DDActiveReports2.ActiveReport
Set rpt = New ActiveReport
rpt.LoadLayout (App.Path & "\fmt01.rpx")
ARD.LoadFromObject rpt
End Sub
Private Sub Command2_Click()
Dim rpt As DDActiveReports2.ActiveReport
Set rpt = New ActiveReport
rpt.LoadLayout (App.Path & "\fmt02.rpx")
ARD.LoadFromObject rpt
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Dim rpt As DDActiveReports2.ActiveReport
Set rpt = New ActiveReport


ARD.LoadFromObject rpt

End Sub





axer 2004-09-24
  • 打赏
  • 举报
回复
'工具栏事件
Private Sub ABar_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
Dim rpt As DDActiveReports2.ActiveReport
Set rpt = New ActiveReport
'显示字体等工具
ARD.ToolbarsVisible = ddTBPropertyToolbox
ARD.ToolbarsAccessible = ddTBPropertyToolbox
Select Case Tool.Name
Case "named": '重命名
rename.Show 1
Case "reload": '
rpt.LoadLayout (App.Path & "\exfmt\fmt00.rpx")
ARD.LoadFromObject rpt

Case "options" '选项设置
F_DSG.Show 1

Case "save": '保存格式

If Len(Trim(fmtlist.Cell(flexcpText, fmtlist.RowSel, 1))) = 0 Then '如果别名为空,不保存
MsgBox Prompt:="尚未指定格式名称,无法保存!", Buttons:=vbOKOnly + vbExclamation, Title:="系统提示"
Else
ARD.SaveToObject rpt
rpt.SaveLayout App.Path & "\exfmt\" & fmtlist.Cell(flexcpText, fmtlist.RowSel, 2), ddSOFile
End If

Case "print": '
rpt.LoadLayout (App.Path & "\exfmt\" & fmtlist.Cell(flexcpText, fmtlist.RowSel, 2))
ARD.LoadFromObject rpt

ARD.Report.PrintReport True

Case "quit": '
Unload Me
End Select
End Sub

以前一个项目的,保存,载入都有了.
paradise885 2004-09-22
  • 打赏
  • 举报
回复
up
paradise885 2004-09-22
  • 打赏
  • 举报
回复
who can tell me?
paradise885 2004-09-21
  • 打赏
  • 举报
回复
我已經知道怎樣生成*.rpx的文件,但是不知道在vb中怎樣調用*.rpx,
請大俠指點!
2910495aaa 2004-09-21
  • 打赏
  • 举报
回复
各位不好意思,我是新来的,楼下的能不能告诉我怎摸发问?小类社区在那?
wumylove1234 2004-09-21
  • 打赏
  • 举报
回复
我也感觉 不清楚.Rpx只有控件,没有代码.
不知如何搞.
axer 2004-09-21
  • 打赏
  • 举报
回复
arp2.0也有几个版本,设计器在专业版里面有,标准版里是没有的。安装完专业版在vb里面会有一个runtimedisigner,他的save和load就是rpx文件。rpx文件实际上就是一个xml文件,你用记事本可以打开,如果不用arp的设计器的话,理论上可以用些文本的方式按照他的格式自己生成一个,存成rpx扩展名,应该也可以使用的。

1,217

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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