By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Bound/Unbound Data Report?

P: 7
I have a small VB6 program that uses Random Access Files. The data is stored in type decs. Can I bind this data to the Data Report or duplicate the data into a recordset and then use this in the data report? Thanks.
Dec 1 '07 #1
Share this Question
Share on Google+
2 Replies


9815402440
100+
P: 180
hi

you can show unbound datareport. use following logic.

dim rstRpt as new adodb.recordset
with rstrpt
.fields.append "fld1",adbstr
.open
.addnew
.fields(0).value = "any value"
end with

with datareport1
.datamemeber = ""
set .datasource = rstrpt
''Draw lables in datareport (in details section) and set their canGrow property to true.
''dont use textboxes in this case.
' i name details section as Det
dim i as integer
for i = 0 to 20
.sections("det").controls("lable1").caption = i & chr(13)
next
.refresh
.show
end with

use can design the report using lables only.

but the best way out is to make recordset at run time and fill it with the values you want
then bind the datareport as follows.

dim rstRpt as new adodb.recordset
with rstrpt
.fields.append "fld1",addouble
.open
dim l as long
for l = 0 to 20
.addnew
.fields(0).value = l
next
end with

with datareport1
.datamemeber = ""
set .datasource = rstrpt
.sections("det").controls("Text1").datamember = ""
.sections("det").controls("Text1").datafield = "fld1"
.refresh
.show
end with


hope this will help you

regards
manpreet singh dhillon hoshiarpur
Dec 1 '07 #2

P: 7
Thanks Manpreet, just what I needed.
Dec 2 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.