data report

printing specific data

Page 1 of 1

11 Replies - 6324 Views - Last Post: 18 April 2012 - 12:37 PM Rate Topic: -----

#1 dyrone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-October 07

data report

Posted 21 February 2010 - 12:35 PM

Good day. i would like to ask help in my program... there is a part in my program that prints reports here how it works...

first the user will search the data with option(by name, ID, date) after searching certain record it will print that record.. only that record. the problem is when i click print and preview what will be printed it show all data in my access data base table... how will i do it, im using data report only... please help.. thanks in advance...

Is This A Good Question/Topic? 0
  • +

Replies To: data report

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: data report

Posted 22 February 2010 - 07:34 PM

you need to pass the filtered data source to the datareport
Was This Post Helpful? 0
  • +
  • -

#3 dyrone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-October 07

Re: data report

Posted 23 February 2010 - 12:04 AM

How will i do it... sorry this is my first time to have this.
Was This Post Helpful? 0
  • +
  • -

#4 janglance  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-February 10

Re: data report

Posted 23 February 2010 - 01:26 AM

...(solution code) >>>> duplication of data in datagrid....
Was This Post Helpful? 0
  • +
  • -

#5 dyrone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-October 07

Re: data report

Posted 23 February 2010 - 01:32 AM

here is the code i tried



Private Sub cmdreport_Click()


Set DataReport1.DataSource = Adodc1.Recordset



DataReport1.Show
End Sub


but there is an error


arguments are at the wrong type, are out of acceptable range,or are inconflict with one another

what is wrong? please help..
Was This Post Helpful? 0
  • +
  • -

#6 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: data report

Posted 23 February 2010 - 01:06 PM

to me, there may be two ways for this errors
  • you create the datareport with the use of DE
  • there is some fields not bound with your recordset(i.e) ther is some textbox with out datamember or wrong datamember

if you create the dr with the use of DE
you need to bind the recordset with DE
for second one
check if you recordset will contain all the fields in the reportfields in the body of the report
Was This Post Helpful? 0
  • +
  • -

#7 dyrone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-October 07

Re: data report

Posted 23 February 2010 - 06:49 PM

I checked all data bind and everything is ok.. do you have any other way to do it?
Was This Post Helpful? 0
  • +
  • -

#8 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: data report

Posted 24 February 2010 - 08:39 PM

there may be some fields hidden in your report or it's wrongly placed try to fix this
or
simply, try this
create a new report with DE and remove the datasource of the datareport and datasource and datamember of the all fields

creating Datareport
About DataEnvironment
Was This Post Helpful? 0
  • +
  • -

#9 dyrone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 08-October 07

Re: data report

Posted 26 February 2010 - 08:29 AM

thank you thava for giving me links.. it will help a lot.. i'll try your suggestions
Was This Post Helpful? 0
  • +
  • -

#10 princebrainbox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-April 12

Re: data report

Posted 17 April 2012 - 04:40 PM

I appreciate your effort; but you have to help us on this matter;
I created a form in VB6.0 and added some textboxes and command button; I added ADODATA CONTROL (Adodc1); I also created an access database (info.mdb). I linked the database(info.mdb) to the adodc1 and equally linked the textboxes controls on the VB form to Adodc1 (using the DataSource and DataField property in the Property Window). I now added a Data Report from the Project Menu. I did not add a Data Environment because I want to make use of FILTER in the Recordset.

I want to be able to view only the filtered records in the Data Report and not all the records in the database;
Here is my code and the Errors:
Private Sub cmdFilter_Click()
On Error Resume Next
With Adodc1.Recordset
                     .MoveFirst
                      .Filter = "surname= '" & txtsearch.Text & "'"
                      If .EOF Then
                       MsgBox "Invalid Data", vbOKOnly, "Search info"
                       Adodc1.Refresh
                       Else
                       
                      End If
End With
End Sub



I added this code in the Initialize Event of the data report

Private Sub DataReport_Initialize()
DataReport1.DataSource = Adodc1.Recordset
 
End Sub



I executed the program and got this error message;
Compile Error:
Method or data member not found

Now I added Set keyword to the code;

Private Sub DataReport_Initialize()
Set DataReport1.DataSource = Adodc1.Recordset
 
End Sub



I executed the program and got this error message;
Run-time error '424'
Object required

Please, I don't know what next to do in order to solve this problem
Was This Post Helpful? 0
  • +
  • -

#11 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: data report

Posted 18 April 2012 - 12:03 AM

Why have you added a comment to a post that's over 2 years old, when you already have a post open the matter that someone has been trying to help you with?
Was This Post Helpful? 0
  • +
  • -

#12 BobRodes  Icon User is online

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,986
  • Joined: 19-May 09

Re: data report

Posted 18 April 2012 - 12:37 PM

Because he's creative. I already asked him not to make duplicate posts, I believe, so he decided to hijack an old one instead.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1