Tutorial for activereports 2.0(visual basic 6.0)

Posted by: jzdexta on 4 August 2017, 5:48 am EST

    • Post Options:
    • Link

    Posted 4 August 2017, 5:48 am EST

    I'm very new to this type of reports and have to understand them in a short while to keep my job.

    Is there any available tutorial for this partcular product and especially working with visual basic 6.0? If the answer is yes could you please direct me to it or maybe publish it in this website's homepage for easier access.

    Thank you in advance.


  • Posted 4 August 2017, 5:48 am EST - Updated 15 February 2023, 1:53 am EST

    The best place to start learning the product are the walkthroughs in our Online Help. You can get to the online help by choosing Support->Online Help->ActiveReports through our menus on this website.

    Let us know if you have any problems.

  • Posted 4 August 2017, 5:48 am EST

    Thank you. Have already started reading the documents though.

    Was wondering do i have to initialize the fields before they get data, can I do it vb6 datareport style where i directly send data to the fields without having to initialize the fields?

    How do i access the properties of the textboxes  by code from a vb6 form( for instance i want to set the datafield of the textbox) ?

    The main idea is to use the same report for different report prints with dynamic data.

    For any tips and tricks please assist me.

    Thank you in advance


  • Posted 4 August 2017, 5:48 am EST - Updated 15 February 2023, 1:53 am EST

    Take a look at the following two Walkthroughs: http://www.datadynamics.com/Help/AR2Std/HX_Dynamic_Reports.html  and http://www.datadynamics.com/Help/AR2Std/HX_Simple_Unbound_Reports.html.

    The first sample demonstrates how to add controls, sections, etc. to the a report at runtime and set their properties.

    The second sample shows how to mainpulate a recordset at runtime to render the report using an unbound approach. This walkthrough uses the Fields' collection. You can also set values to a field control using the .Text or .Value property of the control if you do not want to bind the control to a datafield.

  • Posted 4 August 2017, 5:48 am EST

    Thanx for the walkthroughs but some very vital information is missing as follows:

    Despite the document stating that the fields are unbounded their datafield is indid connected to some field how am i supposed to change that in run time mode because i want to use the same report to display different data depending on a users needs.

    In short how do I manupilate the report from a vb6 form during runtime when it has only controls(textboxes and labels) placed on the report and no properties set other than the "textbox" names?

    Please someone help!!!

  • Posted 4 August 2017, 5:48 am EST - Updated 15 February 2023, 1:54 am EST

    The DataField property is editable at runtime.

  • Posted 4 August 2017, 5:48 am EST

    Thanx for the information already provided.

    The information provided seems to work with controls being added and positioned but my problem is adding data to the fields(text boxes and labels) at runtime without having to add them i.e the report alredy has controls on it which are already formatted rather positioned on the report and only need data to be added to them or get connected to their respective recordset fields.

    NB: All manupilation of the report should be done from a vb6 form with relevant code. Something else is that the report should not have any code in it so as to ensure that the information is all dynamic.

    Can someone work this way?

    An example

    Im getting data from a database say nwind.mdb and the report is to be used to display information about employees, customers and will also be used to show data from a recordset constituting the same number of fields as those of customers which means if i have controls on the report, only the captions and the data they contain changes otherwise create the reports on the fly from a template (not this option) or create a report for each and every type of information i want to print (not recommended).

    Someone please help me.

  • Posted 4 August 2017, 5:48 am EST

    The above link I posted is still revelant, just drop the code to create the controls since you have already done so, so you would have something like this assuming proper report instance called 'ar'....

    ar.Sections("Detail").Controls.Item("Textbox1").DataField = "ExampleID"

     Problem, what do you do if your recordset needs more controls per record? What do you do if it needs fewer? What if the formatting needs and/or width change from recordset to recordset? What if you decide to display bit fields with a checkbox one time and a True/False textbox the next? Which is probably why the recommended solution to a dynamic recordset is to create the controls dynamically as opposed to changing them dynamically as you can technically never have all the controls you might need someday, and then if you don't need said controls they are taking up space and memory.

  • Posted 4 August 2017, 5:48 am EST


    You are saying that after declaring a new report named Ar I simply put this code:

    ar.Sections("Detail").Controls.Item("Textbox1").DataSource = "ExampleID"

    in anticipation my control is textbox1

    what is exampleid could it be the name of my recordset coz when i try your example all i get is an error object doesnot support this property or method

    my report is called activereport1 and recordset is Rs connection is Conn main field is FirstName


    Option 2

    Creating the report on the fly grouped data formatted controls with respective labels bearing relevant headings. Where do I start coz what i have doesnt have labels just floating data


    All the same thanx for the patience

  • Posted 4 August 2017, 5:48 am EST

    Ok based on what we have so far I think the simplist method to get your report running would be to use something similar to the disconnected recordset example found here, http://www.datadynamics.com/forums/425/ShowPost.aspx , I have attached a variation that has removed the DataField references in the report and instead placed them in the form's code. I have run the sample with the Activeconnection still 'on' (i.e. not set = nothing), I am not aware of the reason why or why not to disconnect.

    Bascially what you have here is a pre-designed report layout and a recordset that has already been generated. So instead of passing a query string and letting AR regenerate it's own recordset or doing a full unbound sample, we shortcut and pass the recordset to the AR engine. A decent solution if you have a need to generate the recordset before hand for some reason and just need a quick way to dump it out to paper.

    Now in your case you are taking this a step further and have a generic report setup that you want to send a dynamic recordset to with a variable number of fields. So you need to have unbound controls on the AR at design (no datafield set) and bind those controls via code at runtime after you pass the recordset, but before running/showing the report. In the long run I still think you are going to want to create your AR controls on the fly unless you can keep the number of fields fairly constant somehow. But this is a good place to start as you familarize yourself with AR and it's capabilites.

  • Posted 4 August 2017, 5:48 am EST

    Thanx for the download coz it was perfect and precise to what I wanted and worked like clock work only thing left is in the case of grouped data.

    I now want to move to the next step where I will have to create contols and even disply grouped data on the fly.

    Where do I start?

    Have one example but it has too much of registry references and I dont like much of that stuff, have had too much of the down side with crashed OS coz of corrupted registries

  • Posted 4 August 2017, 5:48 am EST

    The following link has a dynamic reporting example based again on the northwind database. It rather colorfully shows the sections and controls once the report is run [it also demonstrates why the DD team is programming data aware reports instead of pursuing careers in interior design ;) ].


  • Posted 30 September 2019, 6:53 am EST

    HI guys I am using visual basic 6.0 and i am having problem … actually the listboxes were working fine and suddently they stopped retriving data from ms access database…and the database is working fine with other activities or controls… i am posting my code bellow…thanks in advance code]Private Sub Command1_Click() Dim db2 As Database Dim rs2 As Recordset Dim Tot As Integer Dim gst, gtot As Double Tot = 0 Set db2 = OpenDatabase(“D:\OrderMania\ordermania.mdb”) Set rs2 = db2.OpenRecordset(“select * from order1”) While Not rs2.EOF If StrConv(Text3.Text, vbProperCase) = rs2.Fields(7).Value And Text1.Text = rs2.Fields(0).Value And rs2.Fields(9).Value = “Waiting” And rs2.Fields(8).Value = “Pending” Then MsgBox “Customer Yet to be Served”, vbCritical, “Order Waiting” Exit Sub End If rs2.MoveNext Wend

    While Not rs2.EOF If StrConv(Text3.Text, vbProperCase) = rs2.Fields(7).Value And Text1.Text = rs2.Fields(0).Value Then

      List1.AddItem (rs2.Fields(2).Value)
      List2.AddItem (rs2.Fields(4).Value)
      List3.AddItem (rs2.Fields(3).Value)
      List4.AddItem (rs2.Fields(5).Value)
      Text2.Text = rs2.Fields(1).Value
      Text7.Text = rs2.Fields(6).Value
      Tot = Tot + rs2.Fields(5).Value
      lblstatus.Caption = rs2.Fields(8).Value
    End If

    If lblstatus.Caption = “Paid” Then lblstatus.ForeColor = vbGreen

    Else lblstatus.ForeColor = vbRed End If rs2.MoveNext Wend Text6.Text = Tot gst = Tot * 0.05 Text5.Text = gst gtot = Tot + gst Text4.Text = gtot End Sub

  • Posted 30 September 2019, 7:36 pm EST


    We do not provide support for AR 2 now. Please refer the following page’s “Technical Support” tab:

    However, for us to be able to look into the issue to suggest a suitable solution, you may want to share a stripped down application showing the issue.

    Thanks, Esha

  • Posted 4 November 2019, 3:08 am EST

    Hy! I have a problem with AR2 that it writes “The copyright has probably changed”. Ok, you don’t support anymore your old product, but why you didn’t leave the documentation?? .NET and JS Reporting Solutions | Design Custom Reports in Code | ActiveReports and .NET and JS Reporting Solutions | Design Custom Reports in Code | ActiveReports are cancelled. And if I need only a serial number? The old programmer lost the AR2 serial number and now I have to do a little modify on a old program. I install all necessaries files on a new pc. What can I do? I must rewrite a entire program in .NET because you don’t sell a serial number, right?

  • Posted 4 November 2019, 4:54 pm EST


    You can find the documentation for AR2, here:

    And if I need only a serial number? The old programmer lost the AR2 serial number and now I have to do a little modify on a old program. Please share the email address corresponding to which the key must be registered at our end. This shall help me provide you with the same.

    Regards, Esha

Need extra support?

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

Learn More

Forum Channels