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 :wave: . Thanx
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
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! :thumb:
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
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!
Re: Generating Reports from Forms to a Report
Quote:
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? :wave: :wave: :wave: :wave: :wave: