|
-
Apr 3rd, 2006, 07:21 PM
#1
Thread Starter
Addicted Member
Generating Reports from Forms to a Report
Please help me generate reports from the forms to crystal or data report.. i have the details in the text boxes and i dont need database to put it into. i justi need to pass it on a report using crystal report 6.0 or data report for printing purposes . Thanx
-
Apr 3rd, 2006, 08:49 PM
#2
Frenzied Member
Re: Generating Reports from Forms to a Report
well thats kinda easy thing. you can set the value of each control you want to like this
VB Code:
DataReport1.Sections("SectionNameAsString").Controls("ControlNameAsString").Caption = "Your Value" 'you may use .Caption for labels
but theres one problem with data report, you need to connect it to a recordset so that you can run it. you can open a recordset as dummy or you may have it contain data without connecting it to the database, try a search
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Apr 3rd, 2006, 09:10 PM
#3
Thread Starter
Addicted Member
Re: Generating Reports from Forms to a Report
thanks d3gerald.. can u give me a sample code for that.. i placed in Details(section1) a label and i need to get values from my first form(using textboxes) to datareport1. thanx!
Last edited by popodc; Apr 3rd, 2006 at 09:18 PM.
-
Apr 3rd, 2006, 09:22 PM
#4
Frenzied Member
Re: Generating Reports from Forms to a Report
VB Code:
Dim rsTemp As New ADODB.Recordset
rsTemp.ActiveConnection = Nothing
rsTemp.CursorLocation = adUseClient
rsTemp.LockType = adLockBatchOptimistic
'create some fields
rsTemp.Fields.Append "Field1", adChar, 50
rsTemp.Fields.Append "Field2", adVarChar, 50
'you may create more here
rsTemp.Open
'add a record
rsTemp.AddNew
rsTemp.Fields(0) = "Value1"
rsTemp.Fields(1) = "Value2"
rsTemp.Update
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Apr 3rd, 2006, 09:38 PM
#5
Thread Starter
Addicted Member
Re: Generating Reports from Forms to a Report
hanks d3gerald.. can u give me a sample code for that.. i placed in Details(section1) a label and i need to get values from my first form(using textboxes) to datareport1. thanx!
-
Apr 4th, 2006, 03:27 AM
#6
Thread Starter
Addicted Member
Re: Generating Reports from Forms to a Report
 Originally Posted by d3gerald
well thats kinda easy thing. you can set the value of each control you want to like this
VB Code:
DataReport1.Sections("SectionNameAsString").Controls("ControlNameAsString").Caption = "Your Value" 'you may use .Caption for labels
but theres one problem with data report, you need to connect it to a recordset so that you can run it. you can open a recordset as dummy or you may have it contain data without connecting it to the database, try a search
how will i know the controls?? i tried it but up to controls(1) and controls(2) only works?? how can i put controls?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|