|
m2kannan wrote: its very slow to print
Is it faster when you print from Microsoft Word or Internet Explorer? It might very well be that the physical printer can't process the requests faster.
m2kannan wrote: also print character very bold
Try another font, and see if the problem persists. This may be due to the font-setting (printing in bold) or the print-quality setting (high quality?)
It's hard to diagnose the problem based on a short description.
I are troll
|
|
|
|
|
It is very, very unlikely that the font used would make your printing slow. Unless you are trying to do everything in Italic or Bold for a font that doesn't include those styles, and AFAIK TimesNewRoman does include them, so that ain't the cause of your problem.
If you have a slow printer, then you have a slow printer. On the oter hand if it prints OK from Word or other apps, then there's only one possible cause - your code.
Unless you post the part of your code that deals with the printing, it is very unlikely that anybody can really help you. If you do decide to post it DO NOT POST ALL OF IT, just the printing part(s).
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I would like to obtain a datatable from a datasource of a gridview :
Dim Table As DataTableCollection = DsGrid.Tables
BindSource.DataSource = Table(0)
BindSource.Filter = "Nom LIKE '" & SearchNom & "'
Me.DataGridViewVisiteur.DataSource = BindSource
Dim dt as datatable = CType(Me.DataGridViewVisiteur.DataSource, DataTable)
I am getting this message :
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'.
How can i do this ?
Thanks
|
|
|
|
|
I assume it is the last line that is giving the error?
If you would give a description of what it is that you are trying to do, it might help. And I don't mean "i am trying to get a datatable from a gridview to use as a datasource for another gridview" I mean "I am trying to use two gridviews from the same datasource but apply a filter to only one of them".
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I would like to obtain the data that are stored in the datagridview.
|
|
|
|
|
There are two ways that occur to me:
1) you already have the data in Table so you could use Dim dt as datatable = Table(0)
2) alternatively you could use the DataRowCollection of either DsGrid or DataGridViewVisiteur
If these do not suit your needs then I hope that someone else is able to help you.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
The problem is : i give table(0) to my datagrid, and then i use filter on it.
I want to get back the filtered data remaining in my grid.
Table(0) -> contains all data
i apply a filter using a BindSource.Filter .
I want to get back the filtered data ( those on my datagrid view)
How can i do this ? is it possible ?
|
|
|
|
|
The only way I know is to use the Rows property of the DataGridView that displays the filtered data. This is a collection of DataGridViewRow
Take a look at the documentation for any of those terms for examples of how to use them.
There may be other ways of doing what you want, but both of the BindingSource s still access the unaltered data. The filtered one just outputs a filtered sub set to the DataGridView .
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi all, it's my first time in this forum, I hope you can help.
I have a listview that displays a list of PDF files. When the user clicks on a row (in the "selectedIndexChanged" event), I display the selected PDF underneath the Listview in a Webbrowser control
WebBrowser1.Navigate(sFile) So far so good.
Additionally, when the user double clicks a row on the ListView (in the "DoubleClick" event), I use
Process.Start(sFile)
where sFile is the name of the PDF file, to open Adobe Acrobat Reader in a separate process.
Now here's the problem: This only works when the user double clicks the currently selected row. If however, the user double clicks on a row that is not selected in the list view, the application produces two "SelectedIndexChanged" events, and no double click event.
What I've discovered is that if I comment out the line
WebBrowser1.Navigate(sFile)
then my code works as expected. A single click produces a "selectedIndexChanged", a double click produces a "selectedIndexChanged" and a "DoubleClick".
So it seems as if calling WebBrowser1.Navigate(sFile) somehow interrupts the events from firing correctly.
Any ideas on how I could solve this issue?
Thank you.
Chana
|
|
|
|
|
The first thing that comes to mind is, to make a comparison in the SelectedIndexChanged event. When, with the double click, the SelectedIndexChanged event is fired the second time, check to see if the selected index remains the same.
When the SelectedIndexChanged event is fired, and the selected index remains the same, you execute Process.Start(sFile) and otherwise WebBrowser1.Navigate(sFile).
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thank you for your answer. I tried it out, it wasn't exactly what I needed because I would have had to put in a timer to see whether the two clicks came close together etc.
I did find a different workable solution though. ListView has an "activated" attribute, which, when set to "Two Clicks" activates the selected row on the listview in two clicks. This differs from "DoubleClick" because "Two Clicks" allows for some time to elapse between the two.
I put the Process.Start(sFile) into the ListView1_ItemActivate() event and voila! It works!
|
|
|
|
|
Hi
My program should prevent certain processes' IO operations, and only perform them if the user clicks Yes in a Yes/No dialog. Can this be done?
And anyway how can I check wether those processes are running?
Probably there is an API or sg for that, but I'm new to this part of programming.
Much thanks in advance
|
|
|
|
|
The real $M@ wrote: Can this be done?
Not that I'm aware of. You could try and modify the security-attributes of the file, taking away or granting the read/write rights. You'd have to know in advance what file is going to be edited.
The real $M@ wrote: And anyway how can I check wether those processes are running?
Process.GetProcesses() (Source[^])
I are troll
|
|
|
|
|
Hello,
I having one windows application to be developed in VB.Net 2005 the reports requirement is in MS word so please suggest how shall i approach for the same.
I am having my database in Ms Access 2003 in that there is memo field which has one image in it I want to load that image from database to word file.
So please suggest how shall i do it.
Thank You.
|
|
|
|
|
nazimghori wrote: I having one windows application to be developed in VB.Net 2005
Why? use 2008 and target the .net 2.5 framework if you can't use the newer ones
nazimghori wrote: the reports requirement is in MS word so please
so you just have to create word docs?
nazimghori wrote: I am having my database in Ms Access 2003
Again why? there is a free sql server version, much more stable, faster,...
Unless you really have no other choice I wouldn't go for access (there are cases where its usefull but not many)
nazimghori wrote: memo field which has one image
Memo ??? surly it should be OLE-object field.
+ Storing an image in db is very space consuming. Better would be to store the path to the image in the db and the image on the hard disk just as any normal file.
nazimghori wrote: I want to load that image from database to word file.
Amazing isn't it what google can do for you[^]
|
|
|
|
|
dear all
i would like to use euresys library in vb 2008, but i dun know how to set it? any one can tell me how to set it and use it step by step. thanks a lot.
kindly sincerely
|
|
|
|
|
This library, it doesn't come with documentation? The creators don't have a website? Perhaps with examples or support forums??
|
|
|
|
|
You're going to have to contact the makers of that library to get any information about it.
Maybe this[^] is what you're looking for...
|
|
|
|
|
Hello,
I'm hoping that someone can help with two problems I currently have with databinding.
1. I have a couple of checkboxes bound to a form and if I clear my dataset before I change my application to point to another customer, any checkboxes with a checkedstate of checked are reset to unchecked and this is saved in SQL.
2. If I do not clear my dataset before I point to another customer in my application, the correct checkbox state is saved in SQL, however, my databound controls retain customer A's data rather than refreshing with customer B's.
I am connecting to SQL using:
Public Sub SetupDataConnections(ByVal strSQLSelectString As String, ByVal myDataSet As DataSet, ByVal myDataSetName As String, _
Optional ByVal mySQLParameters As SqlParameter() = Nothing)
Try
mySQLConnection = New SqlConnection(_connectionString)
mySQLConnection.Open()
' -- Check connection state
If mySQLConnection.State = ConnectionState.Open Then
myDataAdapter = New SqlDataAdapter(New SqlCommand(strSQLSelectString, mySQLConnection))
' -- If we have some parameters, add them to our command
If Not mySQLParameters Is Nothing Then
myDataAdapter.SelectCommand.Parameters.AddRange(mySQLParameters)
End If
If Not myDataAdapter Is Nothing Then
Using myBindingSource
myDataAdapter.Fill(myDataSet, myDataSetName)
myBindingSource.DataSource = myDataSet
myBindingSource.ResetBindings(False)
End Using
Else
CatchError("You must first create a SQL connection before calling this function")
End If
End If
Catch ex As Exception
CatchError(ex)
End Try
End Sub
Following this Sub, I proceed through:
Public Function SetupBindings(ByVal myDataSet As DataSet, ByVal myDataSetName As String, ByVal myForm As Control) As Dictionary(Of String, Date)
myBindingSource.DataSource = myDataSet
For Each myControl As Control In myForm.Controls
Try
myControl.DataBindings.Clear()
If (TypeOf myControl Is TextBox OrElse TypeOf myControl Is ComboBox) AndAlso Not (myControl.Tag Is "" Or myControl.Tag Is Nothing) Then
myControl.DataBindings.Add("Text", myDataSet.Tables(myDataSetName), myDataSet.Tables(myDataSetName).Columns(GetColumnNameFromControlTag _
(myControl.Tag.ToString)).ToString, True, DataSourceUpdateMode.OnPropertyChanged)
'-- Bind data to associated textbox control
ElseIf (TypeOf myControl Is DateTimePicker OrElse TypeOf myControl Is DateTimeControl) AndAlso Not (myControl.Tag Is "" Or myControl.Tag Is Nothing) Then
'-- ... CONTINUE FOR EACH TYPE OF CONTROL BOUND TO THE FORM ...
ElseIf myControl.HasChildren Then ' -- Recurse back in to function if there are children
SetupBindings(myDataSet, myDataSetName, myControl)
End If
Catch ex As Exception
CatchError(ex)
End Try
Next
End Function
And those two subs set up my data binding. Each control's tag contains the DATABASE.COLUMN mapping.
I would greatly appreciate any assistance.
Cheers,
James
|
|
|
|
|
Hi,
I'm developing an application which uses some additional files ( like images,templates etc).
I have made folders in bin/debug/ dir so that i can access them relative to exe.
Is this a correct way?
As now i am switching to release configuration, I need to copy all these files with dlls which i refer to bin/release directory also.
What should be done ideally?
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Ideally you add an installation / setup project to your solution. Such a project will allow you to add additional files, like drivers, images, etc., and it will allow you to determine where these files will be copied to, during installation.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks for this quicky,
I already have an installation project in solution. But if i add those files only in installation project, How can i access these files/folders while debugging my application?
As my code uses path of exe+path of folder to access those files, folders must be inside application folder.
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Mithun.Shitole wrote: I have made folders in bin/debug/ dir so that i can access them relative to exe.
As long as you only read these files that is acceptable.
From the moment you actually need to alter (write into)/ create these files it's not, and vista won't even allow you to (well it will but it will be in the virtual drive).
Mithun.Shitole wrote: need to copy all these files with dlls which i refer to bin/release directory also.
As suggested you can do this in the setup project.
Just go to where you add the exe ('application folder' if I'm not mistaken), add the folder with the correct name, add the files need into the folder.
Watch out that you add at least one file to each folder created otherwise the setup sometimes doesn't create the folder, don't ask my why but its something I found out the hard way
|
|
|
|
|
Make a function: openfile(path as string)
if the bin directory is in the same parent
directory as the .exe file then do this
call openfile("bin\sample.jpg")
similarly call other files.
TheMrProgrammer
TheCalcMan: A no-mouse required Calculator supporting constant operator and visual effects
Try it once, its awesome!
Just 17.1 KB download.
No installation required. No dlls. Just unrar and go. And its a freeware.
http://www.hotlinkfiles.com/files/2642094_kjwr0/TheCalcMan.rar
|
|
|
|
|
If the files are read only you should be able to include them in your VB project and set the "Copy to output directory" option to "Copy always". That way, the files will always be copied to the bin directory automatically.
|
|
|
|