|
How to create a data report using visual basic 6 and access database
|
|
|
|
|
I made a Data Report form.
I loaded RptImage control on DataReport form and loaded picture on it.
If export as html format, image doesn't be shown.
How I make image show?
Hello everyone
|
|
|
|
|
I have a report designed in seagate Crystal Reaports.
I do not want the user to go and click the export button to export the report in the excel format.
I want my application to automatically export the report in Microsoft Excel and the name and path of the file will be provided by me.
|
|
|
|
|
how to assign values to text boxes on reports at run time
sapna katyal
|
|
|
|
|
hi,
i am doing a project on vb/asp.i want to call a data report from a component(middle tier) in a word/html/doc format.help me in executing this project
rithika
|
|
|
|
|
hi,
i am doing a project on vb/asp.i want to call a data report from a component(middle tier) in a word/html/doc format.help me in executing this project
rithika
|
|
|
|
|
:(After I update a record in the form, then when I show the report, its not updated.
|
|
|
|
|
i think thats maybe because your dataenvironment command is not updated.
try this:
before showing the report,
dataenvironment.commands(command_name).commandtext = your_sql_statement
if dataenvironment.rscommandname.state = adstateopen then
dataenvironment.rscommandname.close
end if
dataenvironment.commandname
datareport.show
example:
dataenvironment = de
commandname = command1
sql_statement = "SELECT NAME,AGE FROM REC_TABLE WHERE AGE > 21"
de.commands("COMMAND1").commandtext = "SELECT NAME,AGE FROM REC_TABLE WHERE AGE > 21"
if de.rscommand1.state = adstateopen then
de.rscommand1.close
end if
de.command1
|
|
|
|
|
hello friends
please help me, i am doing a large project and it is in final stage, please tell me how we call data reports in asp
thanks and looking for response
manoj kaushik
|
|
|
|
|
I want in my detail section of reports 2 records simultaneously by the side of each other. The 3rd record should go below the 1st record . The 4th below the second ?
Is it possible ? If so How ?
|
|
|
|
|
Hi there!
The problem u hav asked have a tricky solution. Create a dummy table by nay name in which u have the fields equal to the double of the fields in the original report and then by using the following loop u can solve ur problem
suppose table is table1 and it have two fields name and age
then u create a table of name table2 having four fields name1, age1,name2 , age2
dim con as new ADODB.Connection
dim rs1 as new ADODB.Recordset
dim rs2 as new ADODB.Recordset
dim name1 as string
dim age1 as long
dim name2 as string
dim age2 as long
con.open "yourdsn","username","passward"
con.execute "delete from table2"
rs1 = "select * from table1",con,adopendynamic,adlockbatchoptimistic
rs2 = "select * from table2",con,adopendynamic,adlockbatchoptimistic
while not rs.eof
name1 = rs.fields("name")
age1 = rs.fields("age")
rs.movenext
if (not rs.eof) then
name2 = rs.fields("name")
age2 = rs.fields("age")
rs.movenext
else
name2 = ""
age2 = 0
endif
rs2.AddNew
rs2.fields("name1") = name1
rs2.fields("age1") = age1
rs2.fields("name2") = name2
rs2.fields("age2") = age2
wend
now set the datareport as per the table2
|
|
|
|
|
There is a problem in above code
the refined code is here:
dim con as new ADODB.Connection
dim rs1 as new ADODB.Recordset
dim rs2 as new ADODB.Recordset
dim name1 as string
dim age1 as long
dim name2 as string
dim age2 as long
con.open "yourdsn","username","passward"
con.execute "delete from table2"
rs1 = "select * from table1",con,adopendynamic,adlockbatchoptimistic
rs2 = "select * from table2",con,adopendynamic,adlockbatchoptimistic
while not rs1.eof
name1 = rs1.fields("name")
age1 = rs1.fields("age")
rs1.movenext
if (not rs1.eof) then
name2 = rs1.fields("name")
age2 = rs1.fields("age")
rs1.movenext
else
name2 = ""
age2 = 0
endif
rs2.AddNew
rs2.fields("name1") = name1
rs2.fields("age1") = age1
rs2.fields("name2") = name2
rs2.fields("age2") = age2
wend
mail me at callparas@rediffmail.com
Nothing
|
|
|
|
|
|
how to insert image control in the report header
i just do it that, but something error about the properties or method object..
'DataReportPortrait.Sections("section1").Controls("img1").picture = LoadPicture("c:\smile2.gif")
any correction? TQ..
|
|
|
|
|
Volla!
How You Might it Found it by now!
as i have researched it on your statement and Found the Solution for what i want. as what we both want was the same.
try the Following :
<big>Set drTest.Sections(2).Controls("Logo").Picture = LoadPicture("c:\logo.jpg")</big>
Segment is asking for an index not the name of the Segment
Cheers!
Pawan Kishore
|
|
|
|
|
I need to create reports using VB in activex control. Is it possible. If yes how?
|
|
|
|
|
Is it possible to generate Datareports using DAO in code.
For example the syntax for creating run time report using ADO is like this.
************************************************************
dim l_adrsReport as ADODB.Recordset
set l_adrsReport = new ADODB.Recordset
l_adrsReport.Open "Select * From Author",<connectionobject>
set DataReport1.DataSource = l_adrsReport
l_adrsReport.close
set l_adrsReport = nothing
************************************************************
But it is not possible to set DAO recordset as Datasource to data report.
Is there any way out?
Have a nice day,
Siva
|
|
|
|
|
I am trying to make a data report which will display list of students admitted between two dates.Beginning and ending date will be passed by users in form at runtime.Pls help me with the solution.
|
|
|
|
|
use command object with cmdunknown property
and then to command() pass the sql query
and refresh the datareport object.
u will have the desired result
email pranavhappy@rediff.com
|
|
|
|
|
Dear Praveen,
plz send me small example ie code for getting report output based on creteria specified in form
thNX
durgesh_par_sharma_123@yahoomail.com
|
|
|
|
|
All you have to do is go to command object properties window u will be immediately into its general tab there two option button will be there select the second one( sql statement) option & write the sql statement
select * from authors where au_id between ? and ?
u can see in the next tab (parameter) two parameters been set for that u can change its name datatype. Depend upon the program u do change its datatype.
close the window by pressing apply button then
go to
Then in the form place a command button
in that click event write
Private Sub Command1_Click()
DataEnvironment1.authors "1", "50" ' the static values
DataReport1.Show
End Sub
if u want to send dynamic values move the value from a textbox into a variable and refer the variable there
Enjoy ur life
bye
Mclarenjaba
|
|
|
|
|
Dear Mclarenjaba
Sub: How make the datareport can be opened many times?
I have tried your method, but it is only halfly-success...
I could open the datareport based on "User criteria", but only for "ONCE" .... If try to open the second or third time .... Coming out the message below:
Msgbox "operation can't process as the object is already open"
Data Environment:
SQL statement:
select * from do_batu where trip_Mast.trip_date between ? and ?
Private Sub Command1_Click()
DataEnvironment1.command1 date1, date2 ' variables
DataReport1.Show
End Sub
HArry the VB6
|
|
|
|
|
You can use query and get start & end date by enclosing "[]", square brackets around them.
e.g select * from xyz where date between [start date] and [end date]
|
|
|
|
|
'You must have a Form, a Module and DataReport
'In DataEnvironment code put this:
Private Sub DataEnvironment_Initialize()
Dim v As Recordset
DataEnvironment1.Connection1.Open
Set v = DataEnvironment1.Connection1.Execute("SELECT * FROM tblStudents WHERE tblStudents.Date BETWEEN #" & data1 & "# AND # " & data2 & "#")
DataEnvironment1.rsCommand1.Open v
End Sub
'In Module define data1 and data2 as Data
'In Form put two text - boxes and a button
'On button_click method assign textboxes.text to data1 and data2 variables
then use datareport.show method
|
|
|
|
|
mungkin dibawah ini bisa memecahkan masalah anda:
example:
at modul1, define conn and RSMASTER as public variable,
insert datareport object without data environment object,
then ini your event component type like this code below.
(i use combobox, is the same if u use other component)
Set Conn = New ADODB.Connection
Set RSMASTER = New ADODB.Recordset
Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DBGaji.mdb"
RSMASTER.Open "select * from Master where month(Bulan)='" & Val(Left(Combo3, 2)) & "' and year(Bulan)='" & (Combo4) & "'", Conn
If RSMASTER.EOF Then
MsgBox "Data tidak ditemukan"
Combo3.SetFocus
Exit Sub
End If
With DataReport6
Set .DataSource = RSMASTER
.DataMember = RSMASTER.DataMember
DoEvents
.Show vbModal
End With
|
|
|
|