473,412 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Data Reports

Hi..

I have a problem in Data Reports in VB 6.0...

I am creating the data report via data environment. I have written the following query in sql builder in the properties dialog box of connection object

"Select empid,empname from param1 where Bookno=param2"

where param1 and param2 are variables that I want to pass to the Data report -

param1 is the tablename that I obtain from combo box on the form and param2 is the value that I obtain from textbox on the form...

Depending on these 2 values I want to display the data report


I am not able to do so....

Please help me out

Thanks

Swagata
Sep 20 '06 #1
3 2087
you have to write the code in the form from where u want to take the printouts first write the query in the command object SQL Statments(using any value of param1 and param2) and then make a report. now while calling that report befor that u have to write the following command
Dataenvironment name is Dtenv1
u r using the first command
then
Dtenv1.Commands(1).CommandType = adCmdText
sql="select empid,empname from" & param1 & " where Bookno=" & param2
(if param2 is integer)
sql="select empid,empname from" & param1 & " where Bookno='" & param2 & "'"
(if param2 is string)
Dtenv1.Commands(1).Execute
Dtenv1.Recordsets(1).Open
If Dtenv1.rsCommand1.RecordCount >= 1 Then
datreport1.printreport
end if

The above code will surel work
bye
Sep 23 '06 #2
please can i have more details about conection to a db and all that please

and another thing, how will will configure the parameters in the report environment itself or is there no configuration that needs to be done?

thx

you have to write the code in the form from where u want to take the printouts first write the query in the command object SQL Statments(using any value of param1 and param2) and then make a report. now while calling that report befor that u have to write the following command
Dataenvironment name is Dtenv1
u r using the first command
then
Dtenv1.Commands(1).CommandType = adCmdText
sql="select empid,empname from" & param1 & " where Bookno=" & param2
(if param2 is integer)
sql="select empid,empname from" & param1 & " where Bookno='" & param2 & "'"
(if param2 is string)
Dtenv1.Commands(1).Execute
Dtenv1.Recordsets(1).Open
If Dtenv1.rsCommand1.RecordCount >= 1 Then
datreport1.printreport
end if

The above code will surel work
bye
Aug 31 '07 #3
add data environment and then you can do a command or an sql statement;
lets say the data environment is DE and has some various connections in it and each data report lets say DR (here you have to put in the properties of the data report which DE it will take from) will take some or all information from the sql query from connection one lets say select * from cust where id = ?
in code put
DE.connection1.open
call DE.DR(id)
DR.show

note code in VB
regards,
moe
Sep 6 '07 #4

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

Similar topics

1
by: Alex | last post by:
Hi all, I've seen this noted in many posts, but nothing I've checked out gives me any clue on how to do this. Basically as my topic says, I have a DTS and I simply need to export some data...
7
by: Paolo | last post by:
I know I should not be doing this, but I find it very useful. I have a database in Access which stores data for a small company. Sometimes we need to add similar information to different tables....
1
by: Queen's | last post by:
I have a database I'm working with which has tables and reports. The controls in the reports are bound to data, but I'm at a loss to explain where the data is coming from. I have gone so far as to...
1
by: Sara Montgomery | last post by:
I have a database I'm working with which has tables and reports. The controls in the reports are bound to data, but I'm at a loss to explain where the data is coming from. I have gone so far as to...
1
by: warlord | last post by:
In order to save typing, I've borrowed the text from a post of nearly 12 months ago.....but the problem still exists. I've been banging my head all day with this, so I'm hoping someone has some...
2
by: Priyavenkat | last post by:
i am using VB 6.0, MS Access as backend and Crystal Reports 10 for reports. I connect data source to Crystal Reports 10 using ODBC dsn. It works correctly in my PC. When it is distributed to another...
5
by: ElTipo | last post by:
Hello People, I made a data base with secure wizard to provide to users a PID and Passwords. I need to extract data from Crystal Reports 7 in this data base but Crystal Reports send me a message...
1
by: babbles | last post by:
I have a problem about data reports. My project is to view reports monthly, yearly and daily and show the query on MShflexgrid and show the total income summary. I have already made my query on that...
10
by: giraffeboy | last post by:
Hi there, I'm having a problem with the Python db api, using MySQL. I've written a program with a GUI using wxPython, the GUI is contained in main.py which imports another module - reports.py....
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.