|
-
Nov 15th, 2000, 12:44 AM
#1
Thread Starter
Lively Member
As the subject said I have a problem with data reports.
I have this data connection (i'll call all the object with the default name) DataEnvironment1 with a connection to my main database of my application, (Connection1) which in turn has a 1 command (Command1). I have to reports which use Command1. So when I want to view DataReport1 or DataReport2 I have the following code:
DataEnvironment1.Command1
DataReport1.Show 1
same goes for 2 instead of DataReport1.Show 1 it will be DataReport2.Show 1
Anyway, I have no problems when I open only one of the reports, but there's an error if I open one report, close it, then open another. The error occurs when I run the
DataEnvironment1.Command1 statement again.
the error message says "The operation requested by the application is not allowed if the object is open..."
so what should I do to work around this?
Thanks in adavance for all the help
-
Nov 15th, 2000, 01:33 AM
#2
Try taking out the DataEnvironment1.command1 line if you are using early binding in the report (datasource set at design time) then it will automatically get the data. Unless you are running it as a query.
What probably is happening is the datareport is calling to open the Command1 at the same time or before the line above is calling it also.
-
Nov 15th, 2000, 03:52 AM
#3
Thread Starter
Lively Member
the problem is I'm running the command1 as a query so I need the line
I tried closing and opening the connection1 and it worked but i'm not sure this is the right way to do it. Can anyone shed some light to the subject?
[Edited by gin on 11-15-2000 at 03:57 AM]
-
Nov 15th, 2000, 10:48 AM
#4
New Member
The Report Object
You have to understand the concept of the reports. You are infact instanciating the report objecyt when you call the reports from your code.
try this method.... I know this is the right method.
dim theReport As datareport1
set theReport = new datareport1
thereport.show
set thereport=nothing
Also.. from your post I am getting this impression that you are not connecting your command object to your report designer. click on the top header of your report designer and make sure that the properties for datasource are set for your dataenvironment and the data filed is set to your command obect....
-
Nov 15th, 2000, 10:48 AM
#5
New Member
The Report Object
You have to understand the concept of the reports. You are infact instanciating the report object when you call the reports from your code.
try this method.... I know this is the right method.
dim theReport As datareport1
set theReport = new datareport1
thereport.show
set thereport=nothing
Also.. from your post I am getting this impression that you are not connecting your command object to your report designer. click on the top header of your report designer and make sure that the properties for datasource are set for your dataenvironment and the data filed is set to your command object....
-
Nov 15th, 2000, 05:44 PM
#6
Thread Starter
Lively Member
thanks fhussain I think i know what you mean. But regarding the connection to the command, I already set all my reports to the proper command.
Basically I can just keep declaring instances of the report i fI plan to show the report more than once right?
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
|