请问如何实现用户可动态选择字段的报表?给详细原代码,高分相送,最多可给到500分。

解决方案 »

  1.   

    自己再来一下,给完整原码者,500分相送,绝不食言EMail:[email protected]
      

  2.   

    把你的E_mail发到[email protected]。我以前做过。
      

  3.   

    这种动态选择字段的问题,适合,需要动态改变的字段不多的情况,实现也不是很难,你可以先做一个显示比较全字段的报表,然后在调用报表的时候让用户选择报表中的哪些字段不需要显示,你在报表预览前通过设置相关字段Visible属性,和调整其他字段的位置,宽度就可以了
      

  4.   

    用水晶报表中的向导来作。Dim m_App As New CRAXDRT.Application
    Dim m_Report As New CRAXDRT.Report
    Dim m_Wizard As New CRStandardWizardSub Main()
        Dim tblCustomer As DatabaseTable
        Dim tblOrders As DatabaseTable
        Dim fldDef1 As DatabaseFieldDefinition
        Dim fldDef2 As DatabaseFieldDefinition
        Dim CustomerIDLink As TableLink
        
        ' Create a blank report
        Set m_Report = m_App.NewReport
        
        With m_Report.Database
            ' Add a datasource to the report.  The wizard will include any data
            ' source that has been added to the report
            .AddOLEDBSource DataEnvironment1.XtremeConnection, "Customer"
            .AddOLEDBSource DataEnvironment1.XtremeConnection, "Orders"
            
            ' Note that if you are adding multiple tables to a report and you want
            ' the tables to be linked, you must add the links before calling the
            ' Report Creation wizard.  There is currently no visual linking done
            ' in the wizard.
            ' Get references to the database tables
            Set tblCustomer = .Tables(1)
            Set tblOrders = .Tables(2)
            ' Get references to each table's Customer ID field
            Set fldDef1 = .Tables(1).Fields(1)
            Set fldDef2 = .Tables(2).Fields(3)
            
            ' Add a link between the two tables
            Set CustomerIDLink = .Links.Add(tblCustomer, tblOrders, _
                                            fldDef1, fldDef2, crJTEqual, _
                                            crLTLookupParallel, False, True)
        End With
        ' Give the report wizard a starting report definition to work with.
        ' If you give it a report that includes other report objects such as fields
        ' or text objects, the report wizard will incorporate those pre-existing
        ' objects into the final report.  In this case, we're giving the wizard
        ' a blank report with some database objects to work with.
        Set m_Wizard.CrystalReport = m_Report
        m_Wizard.DisplayReportWizard        '就这句了
    End Sub
      

  5.   

    http://sgreport.yeah.net
    http://www.uepoch.com
    众合打表,完美支持数据类表格、不规则表格、嵌套表格、票据套打等
    在c/s下与在b/s下效果完全一致
    首创web打印在服务端运行组件,客户端得到的是纯html页面,而打印显示效果与c/s下完全一致,包括斜线之类的特殊效果对于数据表,表格设置中可以选择打印的字段、顺序、分页字段、分组字短等等