ReportMachine OCX

http://rmachine.haotui.com/thread-55-1-1.html

偏高偏低提示

[IF( [RMDBDataSet1."abnormalIndicator"]='h','↑',IF( [RMDBDataSet1."abnormalIndicator"]='l','↓',''))]

 

RMReport.ocx

RMEngine.Init(1); // 初始化
RMEngine.LoadFromFile('c:\1.rmf'); // 读入报表模版
RMEngine.AddDataSet(DataModule2.Customers, 'CustomersDS'); // 增加一个数据表
RMEngine.DesignReport; // 设计报表
RMReport.ShowReport; // 预览报表 

 

c#调用

this.dataSet1 = new System.Data.DataSet();
this.dataView1 = new System.Data.DataView();
this.rmReport1 = new RMReportEngine.RMReport();
this.dataSet1.Reset();

            this.oleDbDataAdapter1.SelectCommand.CommandText = "select * from Customer";
            this.oleDbDataAdapter1.Fill(this.dataSet1, "Customer");
            this.dataView1.Table = this.dataSet1.Tables["Customer"];
            this.dataView1.RowFilter = "CustNo >= 3000";
            //this.dataGrid1.DataSource = this.dataView1;

            rmReport1.ModifyPrepared = false;
            rmReport1.Init(this, TxRMReportType.rmrtReport);
            //rmReport1.PreviewOptions.BtnDesignVisible = true;
            //rmReport1.AddDataSet(this.dataSet1.Tables["Customer"], "db1");
            rmReport1.AddDataSet(this.dataView1, "db1");
            rmReport1.LoadFromFile(MainPath + "reports\\SimpleList.rmf"); //SimpleList.rmf

            rmReport1.AddVariable("公司名称", "我的公司名称", true);
            rmReport1.AddVariable("公司简称", "我的公司简称", true);
            rmReport1.AddVariable("公司电话", "我的公司电话", true);

            if (radioButton1.Checked)
            {
                    rmReport1.ShowReport();
            }
            else
            {
                rmReport1.DesignReport();
            }

 

 

public void AddDataSet(System.Data.DataView aDataView, string aDatasetName)

public void AddDataSet(System.Data.DataTable aDataTable, string aDatasetName)

public void AddDetailDataSet(System.Data.DataTable aDataTable, string aDatasetName, string aMasterName, System.Data.DataRelation aDataRelation)

public void AddVariable(string aVarName, object aVarValue, bool aIsString)

public void GetReportData(ref string aReportData)

public void Init(System.Windows.Forms.Form aOwner, RMReportEngine.RMReportType aReportType)

 

 

web版 RMViewer.ocx

http://rmachine.haotui.com/thread-56-1-1.html

编译client_ActiveForm目录中的项目就会生成RMViewer.ocx

 

com版本

COM控件(ocx)可以在VB、.Net、VC、Delphi等支持ADO的开发工具中使用

ocx版本

Dim conn
    Dim rs
    Dim sql
    Dim rq
    Dim Engine

    Set conn = OpenDBConnection
    Set rs = Server.CreateObject ("ADODB.recordset")
    sql = "SELECT * from customer"
    rs.Open sql, conn, 1, 1

    Set Engine = Server.CreateObject("RMEngine.Engine")
    Engine.Init
    Engine.AddDataSet "db1", rs
    Engine.SetReportFile RootPath & "SimpleList.rmf"
    Engine.ViewerVersion = ViewerVersion
    Engine.ViewerFileName = ViewerFileName
    Engine.SaveReportURL = "asp/DesignReportSave.asp?Report=" & "SimpleList.rmf" 
    Engine.AddVariable "NowTime", Now, false

    Engine.ShowProgress = True

    Set rs = nothing
    conn.Close
    Set conn = nothing

 

VB控件 RMReport7 转:RMReport的使用方法及详解 1、不打印特定的MemoView,套打常用 a.页面设置-->其它-->不打印背景图 b.设置MemoView属性printable=False 2、 如何打印wwDBGrid? 修改rm.inc,如果想支持RX,GIF,JPEG,DimandAccess,Halcyon,DBISAM, EHLib,也需要修改rm.inc //{$DEFINE InfoPower} //修改这行,去掉"//" //{$Ehlib} 3.试用版安装方法(以下假设将文件释放到c:/rm目录中) (1)Tools->Environments Option->Libary->Libary Path中增加: c:/rm/souce c:/rm/bpl $(DELPHI)/Lib $(DELPHI)/Bin $(DELPHI)/Imports $(DELPHI)/Projects/Bpl (2)Component->Install Packages->Add,选bpl/rm_d70.bpl 4.在Delphi IDE中卸载以前的Report Machine版本,然后打开rm_r50.dpk,选"compile", 在打开rm_d50.dpk,选"Install". 包分成了Runtime package和Designer package,所以要安装顺序安装 5、单元格的变量格式用代码设置 t = TRMGridReportPage(RMGridReport1.Pages[0]).Grid.Cells[1, 1].View t = TRMMemoView(RMReport1.FindObject('memo1')); t.DisplayFormat := 'N0.001' //数字型 t.DisplayFormat := 'Dyyyy/mm/dd' //日期型 6、两遍报表如何用代码设置 GridReport1.DoublePass := True 7、用代码写数据字典: RMReport1.Dictionary.FieldAliases.Clear; RMReport1.Dictionary.FieldAliases['RMDBDataSet1'] := '动物'; RMReport1.Dictionary.FieldAliases['RMDBDataSet1."Name"'] := '姓名'; 这样在RM的设计器显示为自定义名称,为最终用户提供友好的显示 8、在报表中如何使用变量(或者如何给某个memoview赋值) a.RMVariables在RM_Class.pas中定义,是全局变量,这样定义后就可以在报表中使用变量"var1",例如: RMVariables['变量名称'] := Edit1.Text; b.用报表中数据字典,TRMReport.Dictionary.Variables,需要注意的是,如果变量是字符型的需要用AsString赋值,其他类型的用RMReport.Dictionary.Variables['var1'] := 1234,例如: RMReport1.LoadFromFile('1.rls'); RMReport1.Dictionary.Variables.AsString['变量名称'] := Edit1.Text; c. 直接对某个单元格赋值,例如: RMGridReport1.LoadFromFile('1.rls'); TRMGridReportPage(RMGridReport1.Pages[0]).Grid.Cells[1,1].Text := '值'; 如果是RMReport: RMReport1.LoadFromFile('1.rmf'); t := RMReport1.FindObject('Memo1'); if t nil then // var t: TRMView t.Memo.Text := 'dsdsdsds'; d.脚本中直接引用Form的值 procedure Main; begin Memo1.Memo.Text := Form1.Edit1.Text; end; 9、自动换行 主项数据栏Stretched = true 文本框 Stretched = true WordWrap = true 10、RM内置变量(Script),增加中.... a.属性PrintAtAppendBlank=True CurReport.AppendBlanking=True时代表增加空行 在RM中,打印设置只能保存页面边距及打印份数、是否两遍打印以及
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值