Tutorial for activereports 2.0(visual basic 6.0)

Posted by: jzdexta on 4 August 2017, 2:48 pm EST

  • Posted 4 August 2017, 2:48 pm 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.


    Jzdexta

  • Replied 4 August 2017, 2:48 pm 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. Or you can use the following link:


    Start Here: http://www.datadynamics.com/Help/AR2Std/AR2Std_start.htm


    http://www.datadynamics.com/Help/AR2Exports/AR2Exports_start.htm


    http://www.datadynamics.com/Help/AR2Pro/AR2Pro_start.htm


    Let us know if you have any problems.

  • Replied 4 August 2017, 2:48 pm 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.

  • Replied 4 August 2017, 2:48 pm 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.

  • Replied 4 August 2017, 2:48 pm EST

    The DataField property is editable at runtime. http://www.datadynamics.com/Help/AR2Std/HX_DataField.html
  • Replied 4 August 2017, 2:48 pm 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!!!

  • Replied 4 August 2017, 2:48 pm 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.

  • Replied 4 August 2017, 2:48 pm 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


       

  • Replied 4 August 2017, 2:48 pm EST

    Option1


    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

  • Replied 4 August 2017, 2:48 pm 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 ;) ].


     http://www.datadynamics.com/forums/95/ShowPost.aspx

  • Replied 4 August 2017, 2:48 pm 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

  • Replied 4 August 2017, 2:48 pm 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.


    2006/01/dsiconnected_wsmith.zip
Need extra support?

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

Learn More

Forum Channels