4 Replies - 13836 Views - Last Post: 05 December 2005 - 08:24 AM Rate Topic: -----

#1 robaster  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-December 05

adding controls to data report

Posted 02 December 2005 - 05:12 AM

hey pple..
i am creating a report wizard for my project. i cant seem to find a way to add controls (rpttextboxes and rptlabels) at runtime based on user requirements.
i know how to use the load() function on forms but it requires a control array which is not available on the datareport.
please help i am stuck.
Is This A Good Question/Topic? 0
  • +

Replies To: adding controls to data report

#2 Xenon  Icon User is offline

  • Connection failed
  • member icon

Reputation: 8
  • View blog
  • Posts: 1,595
  • Joined: 12-September 05

Re: adding controls to data report

Posted 02 December 2005 - 07:47 AM

umm i think you want records on your datareport...
if that's so..

you need to have a VB data environment in your project.

well if you can wait for a day.. ill give a lil example on how to use both effectively/
Was This Post Helpful? 0
  • +
  • -

#3 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: adding controls to data report

Posted 02 December 2005 - 11:41 PM

Well, use the Data Environment to create a Data Report.
Remember not to use the Standard Controls in the Data Report.
Click the 'DataReport' Tab in the Toolbox to open the tab filled with controls that can be added in the Data Report.
Text-boxes can be used in the Detail Band only unlike some others like the Function Control.
Was This Post Helpful? 0
  • +
  • -

#4 Xenon  Icon User is offline

  • Connection failed
  • member icon

Reputation: 8
  • View blog
  • Posts: 1,595
  • Joined: 12-September 05

Re: adding controls to data report

Posted 03 December 2005 - 09:08 AM

here's how you do it,

first add a datareport and a data enviornment by right clicking in the project menu then selecting Add> datareport/ dataenvironment.

then... go to this site, a good description for what your gonna use.
VB Data Environment


the advantage of using data envrionment is that it is done in design time, and doesnt need CODE to work, very handy.
Was This Post Helpful? 0
  • +
  • -

#5 Xenon  Icon User is offline

  • Connection failed
  • member icon

Reputation: 8
  • View blog
  • Posts: 1,595
  • Joined: 12-September 05

Re: adding controls to data report

Posted 05 December 2005 - 08:24 AM

How to bind data environment to data report.

first of all add a data environment and a datareport to the project then.

open the data environ ment, you should see a object in a tree view list called "Connection1"
right click on it, select properties, then this tab appears
Posted Image

i have selected Microsoft OLE DB provider for ORacle, which allows me to use the driver for oracle databases.

click "Next" button to go to the next tab.

this is the next ab that appears.
Posted Image
i have entered the default username & password "Scott" "Tiger" in ORacle DB.

now test the connection if you feel it is necessary by clicking the 'Test Connection' button.

now right click "Connection1" again, this time select "Add Command" from the pop up menu.

Posted Image

now right click on the object that appears below "Connection1" named as "Command1" and select properties.
this tab appears then
Posted Image
now i ve selected the option button "SQL Statement" and entered the SQL query "Select * from emp" which allows me to view all records of the table "emp" in "Scott" user.

now you'll see a "+" sign beside "COmmand1", open it, then also open the data report in the background, both the windows should be seen
like this
Posted Image
now put the mouse pointer on the command1, press and drag the contents onto the datareport, in the "Detail section",

now these steps are important and crucial.
ull now see several labels and textboxes (labels are dashed and textbox outlines are solid) in the datareport,

now place the Dashed labels onto the "Page header section and put the appropriate textboxes underneath those labels, BUT in the "DETAILS section"

now in the property section(right most) of the datareport, set the datasource as "dataenvironment1" and datamember as "COmmand1"

you might be successful, but be sure on how to adjust the report size, it shouldnt be bigger than the page size, then you might encounter errors


hope this helps! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1