Forgot your password?
I nave designed a report using DataReport designer in VB6 (NOT Crystal). This report is bound to some DataEnvironment in design time. I want to bind my report in runtime to my custom ADODB.Recordset (having just the same structure) How to do it?
by:vbWhizPosted on 1999-03-24 at 21:45:12ID: 1500665
4 ways to skin this cat that I can think of:
'The path of least resistance'
Create your commands in the data environment.
Create a DataReport based on these commands.
Find out what the entire SQL statement looks like for your commands (In ADO child command's SQL is embedded into the parent's SQL using the SHAPE command)
Dim myCmd as Command
For each myCmd in DataEnvironment1.Commands
If myCmd.Name = "[Insert the name of your parent command here]" Then
Determine what it is you want to change about this command or sub-commands and locate those spots in the command text.
Write a report-printing routine
Now you can write a routine that replaces the command text in the parent command with the changes you wanted to make.
That routine might look something like this....
Public Sub PrintThatReport(Optional Byval CompanyID as String)
Dim myRpt as DataReport
Dim myCmd as Command
If CompanyID <> "" Then
Set myRpt = New CompanyReport
For Each myCmd In DataEnvironment1
If myCmd.Name = "cmdCompany" Then
myCmd.CommandText = "SELECT tblCompany.* FROM tblCompany WHERE tblCompany.fldCompanyID = '" & CompanyID & "'"
Get unlimited access to solutions & experts
Get Access Now
You may select up to five topics.
Ask My Question
Article by VBRocks
I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008. So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps.
Because there are a lot of programmers that are going to be making this move, I thought I would share this information. I'm certain it will be very valuable to those who are faced with this task.
One of the first things to think about is whether you want to upgrade your VB6 program to a VB.NET 2008 Windows Forms application or a VB.NET 2…
Article by gamesmeister
This example will use a custom field type to create a drop down list populated from a Sharepoint List.
There are four main components to building a custom field&
" Field Class* This must inherit from an existing SPField class. e.g. SPFieldText. It handles custom validation for the field, as well as defining the Field Control used to display it.
" User Control Rendering Template. This defines the control to be used to display the custom field.
" Field Control Class. This contains the code-behind for the user control file, and defines how the control is rend…
Video by AnnieCushing
Answer by eelpark
Question: How do you use an ADO recordet with a DataReport and where to the DataMembers come into play?
I've tried this "DataReport.datasource = ADORS" prior to opening the report.
But now I don't understand how to handle the DataMember to bind the fields.
Answer: Here is most of your answer. There is little information on the dataenvironment/datareport. I am assuming you want to bind the recordset at runtime otherwise you would just use the dataenvironment directly connected to a data report.
You will still have to build the report usi…
Answer by roverm
Question: VB6 sp3, Win98
I have created a report that is based on a command within a data environment. This is easy if the command has no parameters, but if params are required, how do you pass the param values to the command ?
Answer: Just invoke the command first:
DataEnvironment1.Command1 parm1, parm2
then invoke the DataReport:
Answer by garrenb
Question: OK... the question that keeps coming up. HOW do I get the Data Report Designer to work with SQL statements?
I've read it all... In the DataEnvironment:
In Dataenvironment write a command
1)this is in General tab of dataenvironment
SELECT * from customer where custcode = ?
2) In the Paramentrs tab write dataype of …
I had the same frustration as you a while back.
This is a tried, tested and frequently used
piece of code I use to solve that very problem.
Basicially setup the report the way you would like
it to appear, showing all the records.
Initially put a brea…
Answer by pramodkumarsingh
Question: I want to create a report using the VB DataReport generator. This report should be bound to a recordset, and not bound to the database directly. Also, I want to assign the recordset at run-time, because the same report will be used to print multiple recordsets. How do I do this?
Answer: Here is a code that do this u can assign any recordset at run time
HOWTO: Dynamically Populate a Data Report in Visual Basic
This article e…
Join Experts Exchange
About Experts Exchange