Migrating from Crystal Reports

Posted by: emoscosocam-dd on 4 August 2017, 3:00 pm EST

  • Posted 4 August 2017, 3:00 pm EST

    Hello


    I intend to migrate from Crystal Reports and I would like to know how can I replicate the following scenario with Active Reports.


    Please note that I am not using a designer or a viewer, all the report management is within a class


    Dim objApp As CRAXDRT.Application
    Dim objReport As CRAXDRT.Report
     
    Set objApp = New CRAXDRT.Application ' A helper object used below    
    Set objReport = objApp.OpenReport("C:\MyReport.rpt") ' Load a report layout from disk
    With objReport       
        .Database.SetDataSource objRecordset ' Asign the data as an ADO recordset
        .PaperSize = crPaperUser ' Instead of a A4 or Letter papersize, use a customized one.
        .SetUserPaperSize intLenght, intWidth ' set a custom papersize
        .PrintOut ' print by code
     End With


    Thanks a lot for your help


     

  • Replied 4 August 2017, 3:00 pm EST

    Hello ,


    Here is a sample of code:


    Dim ar As DDActiveReports2.ActiveReport
    Set ar = New ActiveReport
    ar.LoadLayout "c:\test.rpx"
    ar.Sections("Detail").Controls("DataControl1").ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NWIND.MDB;Persist Security Info=False"
    ar.Sections("Detail").Controls("DataControl1").Source = "select * from customers"
    ar.PrintReport (False)


    Sergey Romanov.

  • Replied 4 August 2017, 3:00 pm EST

    Thanks a lot for your answer.



    I have 2 more questions:



    1) How can I set a custom paper size?

    2) If I have used the Crystal Reports Conversion Wizard, an ADO Data Control is automatically attached within then definition of the resulting RPX file?
  • Replied 4 August 2017, 3:00 pm EST

    1) You can find all information about PaperSize here:


    http://www.datadynamics.com/Help/AR2Std/HX_PageSetting_PaperSize.html


    2) A conversion wizard won't add the data control automatically, you will need to open RPX file and add this control at design-time.


    Also it's possible to add a needed control in code-behind.


    For more information see the following article:


    http://www.datadynamics.com/Help/AR2Std/HX_Dynamic_Reports.html


    Sergey Romanov.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels