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...
data reportprinting specific data
Page 1 of 1
11 Replies - 4291 Views - Last Post: 18 April 2012 - 12:37 PM
Replies To: data report
#2
Re: data report
Posted 22 February 2010 - 07:34 PM
you need to pass the filtered data source to the datareport
#3
Re: data report
Posted 23 February 2010 - 12:04 AM
How will i do it... sorry this is my first time to have this.
#4
Re: data report
Posted 23 February 2010 - 01:26 AM
...(solution code) >>>> duplication of data in datagrid....
#5
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..
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..
#6
Re: data report
Posted 23 February 2010 - 01:06 PM
to me, there may be two ways for this errors
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
- 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
#7
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?
#8
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
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
#9
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
#10
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:
I added this code in the Initialize Event of the data report
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;
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
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
#11
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?
#12
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.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|