|
Crystal Reports requires a Typed Dataset which, i believe, means you cannot do what you want.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi Ajeet, Try this one
add a form & place a crystalReportViewer control on this form
Dim ob As CrystalSmallLabel = New CrystalSmallLabel
'CrystalSmallLabel is crystal report
Dim ds As New DataSet
Dim da As New OleDbDataAdapter
Dim str As String
str = "select * from label where id=" & id & ";"
mdGlobal.myconnectionOpen() 'mdglobal is module which contain
'procedure to build connection string
da = New OleDbDataAdapter(str, mdGlobal.conn)
da.Fill(ds)
ob.SetDataSource(ds.Tables(0))
CrystalReportViewer1.ReportSource = ob
'CrystalReportViewer1 is CrystalReportViewer control
Me.Show() ' me is the form which contain CrystalReportViewer control
ob.PrintToPrinter(NoOfCopy, False, 0, 0)
'if want direct printing to printer then use above statement
End If
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi,
Please tell me how to allocate memory using Marshal.AllocHGlobal in VB. I am very new to this VB. I am using the code as follows.
Dim returnValue As Long
returnValue = Marshal.AllocHGlobal(250)
But, it's giving the error at run time saying that "Object required".
Can any body please address this issue? If possible please give me the sample piece of code.
Thanks in advance,
AR Reddy
|
|
|
|
|
|
None of this stuff works in VB6.
|
|
|
|
|
This won't work at all. You're trying to use VB.NET code in VB6. VB6 doesn't have a Marshal class.
What does the code look like that you're trying to translate to VB6?
|
|
|
|
|
Then how can we allocate some memory in VB6? is it possible? if yes how can we do this? please give me the sample code if u have.
Thanks
AR Reddy
|
|
|
|
|
Stop. Hold it.
Show us the code that you're trying to translate. Maybe there is an alternative you can use or you might not have to allocate the memory at all!
|
|
|
|
|
hi,
I want to Assign a image to Label Control Dynamically. My Image Is in Resource folder within Solution. I already assign one image to this label control at design time. but at run time at particular condition i want to change the image with other one(Note that i add this image to Resources)
any help will be appreciated
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Have you tried using the ImageList control??
this control enables you to add images (either in design time or run time) then from this control you can retreive the image you want. You have two options to get an image, either by using its index or by using the file name of the image.
hope this helps
|
|
|
|
|
Hi alhokail,
i try to add image to imagelist control, but problem is that this control Fix the size for all Image contain within it. when we reterive image from this control then size of all image is same.
i want to ask that how can i save the original size of each image with ImageList control.
Thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
it seems that you can't control the size of the imagelist as i thought. I say lets return to your resourses folder and try accessing it by supplying the path of the folder to the Image.FromFile function. the resourse folder should be in the executable path if you are only supplying the "Resourses\Image.jpg" to the function.
|
|
|
|
|
hi
can any provied sample code for wininet in vb.net.
for internetwritefile,internetfindnextfile, structure WIN32_FIND_DATA.
tx
|
|
|
|
|
i am doing memory profiling of my application
it shows many string literals staying in memory after closing the
forms where they were used.
Can anyone plz suggest, what is alternative to string literals
because it dont get disposed and increase memory on opening the forms.
Thanks
Milan
|
|
|
|
|
String literals are never disposed. They are compiled into the static data of the assembly, and when you create a string object from a literal, you just get a reference to the static data.
---
single minded; short sighted; long gone;
|
|
|
|
|
then why the profiler is showing me it in memory
|
|
|
|
|
Milan@DIGICorp wrote: then why the profiler is showing me it in memory
Where else would it be?
|
|
|
|
|
i mean that after closing the form where i have used string literal
they dont realease memory they have used
they are of age 40-45 and more.
i think they should be removed as i close the form or the next gc call
|
|
|
|
|
I haven't done the profiling to test this, but there is a theoretical possibility that the static strings will hang around in memory until the assembly that they are loaded from is unloaded. This could be your .EXE or a .DLL that your .EXE loads. If they are in the .EXE, then they'll live for the entire duration your app is running. If in a .DLL, they'll live only so long as when the AppDomain that loaded the .DLL unloads. Again, if your .DLL is not loaded into a seperate AppDomain that you created, they'll live for as long as your application is running.
I can also see the possibility that static strings will never go away, so long as your app is loaded. This is because static information exists without an instance of the class that defined them being created. They exist all the time.
|
|
|
|
|
As I said, the string literals is part of the static data in the assembly. They are loaded when the assembly is loaded, and they are only removed from memory when the assembly is unloaded.
Using a string literal doesn't use any memory. The memory is already allocated for the static data. Using a string literal doesn't allocate any more memory, so there is no memory to free when you don't use the string any more.
---
single minded; short sighted; long gone;
|
|
|
|
|
can i programatically find out the window which was last opened (just opened).
eg i opened the c:\program files then c:\windows .
then my program should tell that the freshly opened document is C:\Windows.
|
|
|
|
|
There's no API that does this directly.
You can get notifications of window creation and destruction if you implemented a Window Hook called CBT. This article[^] gives a limited view of a .NET implementation of the CBT hook.
Warning! Windows Hooks is VERY advanced topic and requires knowledge of how Windows works internally to understand it.
|
|
|
|
|
iam new to vb.net,iam posting the code i hav written please make modifications where ever neccesary
cmd.Connection = cn
cmd.CommandText = "select max(EMP_CODE)+1 as lastfrom EMP_DETAILS where EMP_PLACE='" & ComboBox1.Text & "'"
cn.Open()
While dr.Read
cmd.ExecuteScalar()
TextBox1.Text = dr.Item("last")
End While
cn.Close()
|
|
|
|
|
Hi
Check this example and apply your code .. You need not use while loop if you are executing ExecuteScalar as it returns one row only.
Example from MSDN[^]
Hope you got it..
Harini
|
|
|
|
|
iam vb6.0 programmer,this code works fine in vb6.0,how to write same code in vb.net
|
|
|
|