hey all,
this is a repost because the more i thought about it the more i think i
posted in wrong area, please forgive me if redundant post. anyway:
i have a single function i'm working on;
If var=a
dim oCr as reportType1
elseif
dim oCr as reportType2
endi if
oCr.Export
I'm getting the squiggly under oCr.Export saying not defined. What is a good
way to resolve this?
thanks,
rodchar 12 1174
You are defining oCr inside an If block, which isn't visible outside the
If block.
I don't know what the rest of your code looks like so I'm not sure, but
this may work.
dim oCr as Object
If var=a
oCr = ctype(MyReportName,reportType1)
elseif
oCr = ctype(MyReportName,reportType2)
endi if
oCr.Export
*** Sent via Developersdex http://www.developersdex.com ***
"Terry Olsen" <to******@hotmail.com> schrieb You are defining oCr inside an If block, which isn't visible outside the If block.
I don't know what the rest of your code looks like so I'm not sure, but this may work.
dim oCr as Object If var=a oCr = ctype(MyReportName,reportType1) elseif oCr = ctype(MyReportName,reportType2) endi if
oCr.Export
The type Object does not have a method 'Export'. This doesn't compile.
Armin
"rodchar" <ro*****@discussions.microsoft.com> schrieb hey all,
this is a repost because the more i thought about it the more i think i posted in wrong area, please forgive me if redundant post. anyway:
i have a single function i'm working on;
If var=a dim oCr as reportType1 elseif dim oCr as reportType2 endi if
oCr.Export
I'm getting the squiggly under oCr.Export saying not defined. What is a good way to resolve this?
dim oCr as CrystalDecisions.CrystalReports.Engine.ReportDocum ent
If var=a
oCr = reportType1 'pseudo-code: assign the report object here
elseif
oCr = reportType2
endi if
oCr.Export
Armin
Unless you have Option Strict Off, which unfortunately many do. Of course
there would be no point of doing the CType then.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... "Terry Olsen" <to******@hotmail.com> schrieb You are defining oCr inside an If block, which isn't visible outside the If block.
I don't know what the rest of your code looks like so I'm not sure, but this may work.
dim oCr as Object If var=a oCr = ctype(MyReportName,reportType1) elseif oCr = ctype(MyReportName,reportType2) endi if
oCr.Export
The type Object does not have a method 'Export'. This doesn't compile.
Armin
"Terry Olsen" <to******@hotmail.com> schrieb: You are defining oCr inside an If block, which isn't visible outside the If block.
True.
I don't know what the rest of your code looks like so I'm not sure, but this may work.
dim oCr as Object If var=a oCr = ctype(MyReportName,reportType1)
The cast is not necessary because 'Object' is the super type of any type.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
"rodchar" <ro*****@discussions.microsoft.com> schrieb: this is a repost because the more i thought about it the more i think i posted in wrong area, please forgive me if redundant post. anyway:
i have a single function i'm working on;
If var=a dim oCr as reportType1 elseif dim oCr as reportType2 endi if
oCr.Export
I'm getting the squiggly under oCr.Export saying not defined. What is a good way to resolve this?
If 'ReportType1' and 'ReportType2' have a common base type which defines the
'Export' method, you can use something like this:
\\\
Dim cr As Report
If var = a Then
cr = New ReportType1()
Else
cr = New ReportType2()
End If
cr.Export()
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
looks like this one worked, thanks everyone for the great feedback.
"Armin Zingler" wrote: "rodchar" <ro*****@discussions.microsoft.com> schrieb hey all,
this is a repost because the more i thought about it the more i think i posted in wrong area, please forgive me if redundant post. anyway:
i have a single function i'm working on;
If var=a dim oCr as reportType1 elseif dim oCr as reportType2 endi if
oCr.Export
I'm getting the squiggly under oCr.Export saying not defined. What is a good way to resolve this?
dim oCr as CrystalDecisions.CrystalReports.Engine.ReportDocum ent
If var=a oCr = reportType1 'pseudo-code: assign the report object here elseif oCr = reportType2 endi if
oCr.Export
Armin
Herfried, dim oCr as Object If var=a oCr = ctype(MyReportName,reportType1)
The cast is not necessary because 'Object' is the super type of any type.
Have a look at the answer from Armin.
Is that is the fact than your answer from yesterday about the html.control
was completely wrong. (While it was not in my opinion).
Cor
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb: dim oCr as Object If var=a oCr = ctype(MyReportName,reportType1)
The cast is not necessary because 'Object' is the super type of any type.
Have a look at the answer from Armin.
Is that is the fact than your answer from yesterday about the html.control was completely wrong. (While it was not in my opinion).
Huh?! 'Object' is the super type of any type, but 'HtmlControl' is not the
super type of 'WebControl' or any of its derived types.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Herfried, Huh?! 'Object' is the super type of any type, but 'HtmlControl' is not the super type of 'WebControl' or any of its derived types.
Not the super type, that is object, however Webcontrol it is the base for
the htmlcontrol. See my message in that thread to Armin (I was suprissed as
well).
Cor
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb: Huh?! 'Object' is the super type of any type, but 'HtmlControl' is not the super type of 'WebControl' or any of its derived types. Not the super type, that is object, however Webcontrol it is the base for the htmlcontrol. See my message in that thread to Armin (I was suprissed as well).
That's wrong. Both, 'WebControl' and 'HtmlControl' inherit from
'System.Web.UI.Control', but neither one is the base type of the other one.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Herfried, That's wrong. Both, 'WebControl' and 'HtmlControl' inherit from 'System.Web.UI.Control', but neither one is the base type of the other one.
Whatever but both don't have the member 'item' and that is for me what Armin
is correct in.
Object does as well not have all items from its derived classes.
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bob |
last post by:
Hallo,
I have to make a web application in Javascript/ASP for tenniscourt
reservation (based on Access database). I would like to do everything with
one page, because the user must be able to...
|
by: Marquisha |
last post by:
If this is off-topic, please forgive me. But I thought this might be
the perfect spot to get some advice about how to proceed with a
project.
Working on a Web site design for a nonprofit...
|
by: Alex Shefer |
last post by:
I have ASP.NET web application running on Microsoft Server 2003.
It works fine for many clients but one of my clients gets a "File
Download" dialog "Some files can harm your computer" trying to see...
|
by: yuyazhang |
last post by:
Hi ,
I am a graduate , I have had some basic knowlege about C++ ! but
I find that I can't master it , I am disappoint for that . who give me
some advice about ways which master it and some...
|
by: johannblake |
last post by:
First off, I am NOT a beginner. I have lots of experience developing
professional web sites and am a professional software developer.
Unfortunately I've been out of web site development for the...
|
by: vishsid3 |
last post by:
Hi guys , I am new to this forum .
can anybody plz tell me - "how can I run a c executable in some
directory ,while the executable is in some other directory "
I am new to unix and c ,so any...
|
by: Digital Puer |
last post by:
I'm not the world's greatest C++ programmer, so I had a hard
time with these. Some help would be appreciated.
1. Comment on the declaration of function Bar() below:
class Foo
{
static int...
|
by: =?Utf-8?B?RW1tYSBIb3Bl?= |
last post by:
Hi All,
I need some advice please. I have very good knowledge of MS Access, Excel
etc, reasonable knowledge of VBA and some very basic knowledge of VB6 and
virtually non-existant knowledge of...
|
by: jon121970 |
last post by:
I'm new here.. I am hoping to get some Professional Advice.
I want to start my own online Auction. I anticipate it will grow into a high volume/high traffic online auction. I need some...
|
by: azrael |
last post by:
I am starting to work on a application and need some advice.
I am planing to develop a desktop application which would have some
usage, but also it should be able to comunicate to a web server...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |