473,385 Members | 1,693 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,385 software developers and data experts.

how to solve Report As New CrystalReport3 thisuserdefinend is not type error in vb0.6

Expand|Select|Wrap|Line Numbers
  1. Dim Report As New CrystalReport3
  2.  
  3. Private Sub Command1_Click()
  4.   Dim Report As New CrystalReport3
  5.   Report.Export = True
  6.  
  7. End Sub
  8.  
  9. Private Sub Form_Load()
  10. Screen.MousePointer = vbHourglass
  11. CRViewer1.ReportSource = Report
  12. CRViewer1.ViewReport
  13. Screen.MousePointer = vbDefault
  14.  
  15. End Sub
  16. how to solve Report As New CrystalReport3 this userdefinend is not type error in vb0.6
  17. Private Sub Form_Resize()
  18. CRViewer1.Top = 0
  19. CRViewer1.Left = 0
  20. CRViewer1.Height = ScaleHeight
  21. CRViewer1.Width = ScaleWidth
  22.  
  23. End Sub
Nov 29 '12 #1
3 1988
Stewart Ross
2,545 Expert Mod 2GB
You do not appear to have defined what the user-defined type CrystalReport3 refers to. You cannot use a user-defined type without declaring to what it refers.

To use a crystal reports library you will have to declare a reference to it in your code - unless you do so you won't be able to use it at all.

There are other problems with your code - your sub in lines 3 to 7 cannot do anything as you did not set the newly-created report to any value. As it will not have any contents, how can you export anything from it?

-Stewart
Nov 29 '12 #2
i don't understood your answer
Nov 29 '12 #3
Stewart Ross
2,545 Expert Mod 2GB
Perhaps you are not ready for using code libraries if you do not know how to set a reference to them.

Have a look at the following link for further guidance on installing Crystal Reports in VB6. Section 10 shows you how to set a reference to the Crystal Reports control.
http://www.vb6.us/tutorials/using-cr...s-vb6-tutorial

This will not in itself help you to write useful code, as it can't tell you the steps you must follow. You have to work these out for yourself.

As I said in my first reply, the sub you show in your original post cannot work as you have not set up the crystal reports object it refers to with any contents at all.

You have written:

Expand|Select|Wrap|Line Numbers
  1. Dim Report As New CrystalReport3
  2. Report.Export = True
How do you get from the Dim to the export? The report object has not been set to anything at all - there is no database involved, no report loaded, nor anything from what you have posted that could provide the declared object with something to export.

-Stewart
Nov 29 '12 #4

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

Similar topics

102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
7
by: darrel | last post by:
What does that MEAN? I'm working on a VS project with another person. We keep our DLLs and files in sync with each other. Last week I hit a snag where i kept getting the 'could not load type'...
0
by: Curtiss | last post by:
I receive "could not load type" error message when trying to load aspx page. The DLL is built and is located in the correct bin directory. The type name in the "inherits" attribute matches the...
3
by: pmiller | last post by:
I ported my code from the development to application platform, I found a "type error" on a fileout statement: outfile.write(object.id +",") Object.id is provided by a library routine that is...
3
by: Alden Pierre | last post by:
Hello, I'm having a hard time trying to figure why my code will not compile. When I try to compile the code, I get the non-aggregate type error. Any ideas on what I'm doing wrong? ...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
13
by: imutate | last post by:
Hi, I am migrating some std::vectors to use a template instead, but I get an incomplete type error in a struct declaration. #include <vector> template < typename T > class Vec : public...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
2
by: unclefester | last post by:
I have two classes: Test1 and Test2. Test1 has a field of data type Test2, & vice versa. I need some help in avoiding the incomplete type error ("Error: field has incomplete type"). Test1.h ...
6
by: kmtech | last post by:
I have a spreadsheet named Log with data in range A11:X1200 that I would like to change each raw's background color based on the value in column Y for that raw. Column Y values are set between 1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
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...
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...

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.