|
hi friends,
i am facing problem in calling a crystel report from vb.net having on demand sub
reports.
My main report has 4 params and on demand sub report has 2 params. The code of passing
params is running perfectly without any sort of error but when i assing my reportdocument
object (report) to the crviewer object ( crViewer.ReportSource = rpt) is shows me
parameter input value box. The things work fine with report having no on demand sub report.
following is the code for parameter passing and calling the report
Dim crParameterFields As New ParameterFields()
Dim crParameterField As ParameterField
Dim crParameterDiscreteValue As ParameterDiscreteValue
crViewer.ParameterFieldInfo = Nothing (created at design time)
On Error GoTo eHandle
'rpt.DiscardSavedData()
crParameterDiscreteValue = Nothing
crParameterField = Nothing
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterField = New ParameterField()
crParameterDiscreteValue.Value = v_sCompanyName
crParameterField.ParameterFieldName = rpt.DataDefinition.ParameterFields(0).Name()
crParameterField.CurrentValues.Add(crParameterDiscreteValue)
crParameterFields.Add(crParameterField)
crViewer.ReportSource = rpt ( shows paramters input box at this line)
i would be helpful if someone could help me out. I have searched on many sites but not much
info is received.
thank you very much
Vaibhav Shah
|
|
|
|
|
Hi. I have been asked to develop my first telephony application. I think I want to do it with Visual C++ or Visual Basic.NET. The application: A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer. Does anyone know of existing libraries that might be helpful? Do we need a special modem? Does anyone know if it might be easier to implement in another language? Any help would be greatly appreciated.
|
|
|
|
|
SuperGeek wrote:
A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer.
If by this description you mean that the user should be able to pick up his phone and use the computer program to dial VM and interact with it via the DTMF menus that the user would normally press then it is not too difficult. Depending upon the OSs that you need to support, take a look at Tapi (V2 or V3). V3 places a COM wrapper around Tapi making it a bit more VB friendly that V2 was. V2 was/is very difficult to use via VB because of it's extensive use of pointers, variable length structs (requiring much use of memcopy) and callback functions.
If by this description you mean that you want to make messages left in a users mailbox available via some GUI interface, then things can get much prettier or much uglier, depending on the VM system you are working with....
If the VM stores it's messages in a open store (DB or directory structure) and in some format that you can get a coder to play, then it might not be tooooo difficult. These types of systems are called 'Unified Messaging’ (UM), and generally are developed as part of the VM platform itself as a value-added feature (to get more money). You might not be able to get things too tightly coupled if this is your intent unless the VM maker has designed the system to be open and extensible (don’t know many that do).
If low cost UM is what you are after, you might just be better off writing your own from scratch. Trust me when I say this.. I help folks do things like this for a living. It MIGHT just be simpler to start over
|
|
|
|
|
Thanks for advice. I will have to look into the TAPI. I would prefer to work in VB or VB.NET. The application is really supposed to be a GUI that let the operator here voice mail and exercise the options in the voice mail. I do not think we are going to be supporting any sort of database. We are dialing the voice mailbox, sending the tones through the phone line, for example if the option is press 2 for "To Reply to this Message" the user could click a button for reply and the software would send the tone for two. I think we can get by with only supporting windows 2000 or XP.
|
|
|
|
|
|
THANKS! I have never seen that gotdotnet site before, I think I may start spending some time there. I think TAPI is definetly the way to go, (assuming I have a modem that supports TAPI). Does anyone know of any good books or websites that detail the TAPI functions?
|
|
|
|
|
Ok, I am halfway done for implementing my telephony application and I encountered a major problem. I am using a ZOOM USB Modem and was stunned to learn that it is half duplex. When I dial the phone, and the voice mail answers I can set tones and transmit voice, but I cannot hear what is going on at the other end. How do I switch from a send state to listening state?
|
|
|
|
|
In vb6 there was a drive list box & a dirlistbox showing familiar drive & folder structure in tree form, not so in vb.net
I need users to select a folder, then I will get all files in that folder to an array,
theopen file & save file dialog boxes are visually what I want but not their functionality, ie I dont want user to open a file or save a file, just get them to select a folder for which I can save the folder name & get it's files
thanks fo nay constructive help/suggestions
44Class
|
|
|
|
|
|
Check this link. A good example of using dirListBox, DriveListBox in VB .NET. Very easy to implement. Cheers
http://www.dotnetjunkies.net/tutorials.aspx?tutorialid=392
Zulfikar Ali
|
|
|
|
|
I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph:
Object Collections and Object Arrays
When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes:
* An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
* Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array.
* If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection.
I am bugged by the first bullet point here... Sounds very wrong to me...
|
|
|
|
|
Ray Cassick wrote:
An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
Evidently an array is faster either way.
I'm thinking the Collection will be faster for random access, but I wouldn't swear to that.
Paul
|
|
|
|
|
Ray Cassick wrote:
An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
Correction:
Collections are usually implemented using linked lists. Both linked lists and arrays provide fast sequential access. But for random access, arrays are faster.
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Hi,
I write a small class to access to database. This class is refered in two project which are in the same solution.
In Project2, I call a class in Project1 which contain a method that need in parameter my DBClass.
All was ok still this week. Now everytime I compile the solution, I get the following error :
error BC30311: Value of type 'InfoDB.DataAccess' cannot be converted to 'InfoDB.DataAccess'.
Where should be the matter ?
Thx for help.
Sybux
|
|
|
|
|
Try first coping this file elsewhere (thru' windows explorer) then delete it from your project and add it.
Just give it a try.
|
|
|
|
|
I've already try this. I even deleted all file named as my DLL and it's still not working
|
|
|
|
|
Hi,
I'm having a problem for the first time: I open visual studio .net and the start page is shown, then, if I click any of the links that need an internet connection, I get this message: "This feature requires that you have connected to the internet previously or are currently online". Which is impossible, because I have a cable connection, so... I'm always online....
This problem start happening when I tried one of those "Speed Up Your Computer and Internet Connection" programs (you know, just to see how it works)... the name of the software is "Dr. Salman's Windows Power Tools 4.0".
I've been checking and unchecking for some days now, but I just can't get it to work right!
Thanks...
|
|
|
|
|
I have declared 'NetServerEnum' function in module as follows;
Public Declare Function NetServerEnum Lib "netapi32.dll" ( _
ByVal servername As String, _
ByVal level As Integer, _
ByRef buffer As Integer, _
ByRef prefmaxlen As Integer, _
ByVal entriesread As Integer, _
ByVal totalentries As Integer, _
ByVal servertype As Integer, _
ByVal domain As String, _
ByVal resumehandle As Integer) As Integer
when i call it, i get an error saying
"Object reference not set to an instance of an object."
Can anyone help me out?
Thanks in advance.
|
|
|
|
|
The error message usually means that the declaration is wrong, i.e. passing arguments ByVal instead of ByRef.
The C++ declaration is:
NET_API_STATUS NetServerEnum(
LPCWSTR servername,
DWORD level,
LPBYTE* bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
DWORD servertype,
LPCWSTR domain,
LPDWORD resume_handle
);
In VB.NET, this translates to:
Public Declare Function NetServerEnum Lib "netapi32" ( _
ByVal ServerName As IntPtr, _
ByVal Level As Integer, _
ByRef Buffer As IntPtr, _
ByVal PrefMaxLen As Integer, _
ByRef EntriesRead As Integer, _
ByRef TotalEntries As Integer, _
ByVal ServerType As Integer, _
<MarshalAs(UnmanagedType.LPWStr)> _
ByVal Domain As String, _
ByVal ResumeHandle As IntPtr _
) As Integer
You then call it as:
...
Dim EntriesRead As Integer = 0
Dim TotalEntries As Integer = 0
Dim Buffer As IntPtr = IntPtr.Zero
Dim nRes As Integer = NetServerEnum( _
IntPtr.Zero, _
Level, _
Buffer, _
-1, _
EntriesRead, _
TotalEntries, _
ServerType, _
DomainName, _
IntPtr.Zero _
)
Try
'Do some stuff here
...
Finally
'Clean up buffer
If Not(Buffer.Equals(IntPtr.Zero)) Then
NetApiBufferFree(Buffer)
End If
End Try
|
|
|
|
|
Thanks it works fine.
what do i need to do to use netapi32.dll in win9x/NT.
More help please.
Thanks.
|
|
|
|
|
NB: Please post any responses to the forum, so that other users get the chance to answer them!
Vipul Bhatt wrote:
Thanks a lot.
It worked.
Can you please tell me how i point to next memory location as
TempBufPtr = TempBufPtr + SIZE_SI_101
gives me an compile time error saying datatype conversion error where
TempBufPtr As IntPtr AND
Public Const SIZE_SI_101 = 24
Thanks in advance.
Also where can i find info about these API functions as i was unable to find the correct declaration info.
THANKS ONCE AGAIN.
To move an IntPtr in VB.NET, you need to re-create it:
TempBufPtr = New IntPtr(TempBufPtr.ToInt32() + SI_SIZE_101)
The best place to find information about any API is MSDN:
http://msdn.microsoft.com/[^]
Also, take a look at this article, which makes extensive use of the NetServerEnum function:
http://www.codeproject.com/csharp/ServerComboBox.asp[^]
|
|
|
|
|
Thanks Richard. Great help.
Can U pls. tell me how can i use the RtlMoveMemory in VB.NET and also do i need to convert pointer to string later. If yes please tell how do i do that.
I tried using marshal.PtrToStringUni but in vain.
hope i will get similar response as earlier.
Thanks in advance.
|
|
|
|
|
Vipul Bhatt wrote:
tell me how can i use the RtlMoveMemory in VB.NET
Don't! For most cases, using the MarshalAs and StructLayout attributes will be sufficient. In cases when these don't work, the Marshal class provides functions to convert between managed types and IntPtr s.
For example:
Imports System.Runtime.InteropServices
'
Public Enum PlatformID
DOS = 300
OS2 = 400
NT = 500
OSF = 600
VMS = 700
End Enum
'
<Flags> _
Public Enum ServerType
None = &H00000000
Workstation = &H00000001
Server = &H00000002
SQLServer = &H00000004
DomainController = &H00000008
DomainBackupController = &H00000010
TimeSource = &H00000020
AFP = &H00000040
Novell = &H00000080
DomainMember = &H00000100
PrintQueue = &H00000200
Dialin = &H00000400
Xenix = &H00000800
Unix = Xenix
NT = &H00001000
WFW = &H00002000
MFPN = &H00004000
NTServer = &H00008000
PotentialBrowser = &H00010000
BackupBrowser = 0x00020000
MasterBrowser = &H00040000
DomainMaster = &H00080000
OSF = &H00100000
VMS = &H00200000
Windows = &H00400000
DFS = &H00800000
ClusterNT = &H01000000
TerminalServer = &H02000000
DCE = &H10000000
AlternateXPort = &H20000000
ListOnly = &H40000000
DomainEnum = &H80000000
All = &HFFFFFFFF
End Enum
'
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Public Structure SERVER_INFO_101
'
Public dwPlatformID As PlatformID
'
<MarshalAs(UnmanagedType.LPWStr)> _
Public lpszServerName As String
'
Public dwVersionMajor As Integer
Public dwVersionMinor As Integer
'
Public dwType As ServerType
'
<MarshalAs(UnmanagedType.LPWStr)> _
Public lpszComment As String
End Structure
In this case, fields of type DWORD map to Integer s, or Enum s based on Integer (the default). Fields of type LPWSTR map to String s with the MarshalAs(UnmanagedType.LPWStr) attribute.
Then, assuming TempBufPtr is an IntPtr pointing to the current item, you can use:
Imports System.Runtime.InteropServices
...
Dim tS As Type = GetType(SERVER_INFO_101)
Dim currentItem As SERVER_INFO_101
currentItem = DirectCast(Marshal.PtrToStructure(TempBufPtr, tS), tS)
Dim ServerName As String = currentItem.lpszServerName
No need to call RtlMoveMemory , no need to convert pointers to strings!
For more information on marshalling between managed and unmanaged code, have a look at http://msdn.microsoft.com/library/en-us/cpguide/html/cpconmarshalingdatawithplatforminvoke.asp[^]
|
|
|
|
|
It worked
A BIG THANKS RICHARDS.
Great help.
God bless you.
|
|
|
|
|
Thanks Richard,
only one change required:
currentItem = DirectCast(Marshal.PtrToStructure(TempBufPtr, tS), tS)
Just replace tS with Object as below
currentItem = DirectCast(Marshal.PtrToStructure(TempBufPtr, tS), Object)
A big thanks to you.
|
|
|
|