|
The code is scattered in out modules.
Is there a better way of doing the word copy / paste and then replace?
Also every time I paste code into this box the browser hangs up and I loose everything entered include just 1 line (i.e. CodeProject.com not responding).
|
|
|
|
|
Look at doing a mailmerge into the Word document, with the QuickBooks DB as the data source
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
That would not work since much of the data is not in QuickBooks. The Docx Template is also very complex. (We do use mail merge that with other programs when it fits but not with QB as a source but from an extracted file). The program also will save as a PDF and email the invoice once the new Docx file is created.
Really need to know how to speed up what we have currently.
Are certain Word functions just extremely slow? Are there replacements that can be used.
|
|
|
|
|
QuickBooksDev wrote: Are certain Word functions just extremely slow
YES!
It is why Office should never be used in a development environment, that and the versioning nightmare it creates.
Personally I would use a proper reporting tool to generate the invoices. SSRS, Telerik, Dev Express all have excellent reporting tools that will use disparate data sources and produce the most complex output you could require.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It is a bit late to change to something else.
What Word interfaces are extremely slow and what can be done about it?
|
|
|
|
|
Hi Everyone
This is an odd one, so please bare with me. I have a list of players in a football team in a list box. I then have two combo boxes with the same list of players in.
For a player substitute I need to be able to select the player on in one combo box, player off in the other and then switch their names round so player one appears where player two was and vice versa.
To then make it more complex, I need this to be reflected in the combo box.
I tried a very basic:
Dim floatingName = SubOn.SelectedItem
SubOn.SelectedItem = SubOff.SelectedItem
SubOn.SelectedItem = floatingName
but its not as simple as I'd hoped. Also this wouldn't make a difference to the list box.
Can anyone give me some pointers please?
Thanks in advance.
Steve
Slowly learning... if only there was more time in the day!
|
|
|
|
|
You need to remove each player from its ComboBox and then replace them. Just using references as above will not do it.
|
|
|
|
|
How to test The performance Of a Vb.Net Pc Cleaner Software?
|
|
|
|
|
1. Design some tests
2. Run the tests
3. Examine the results
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
You say that like we're supposed to know exactly what this app does and how it does it.
A "cleaner" app can mean anything and do anything.
Your version of "performance" needs to be defined in very specific terms.
|
|
|
|
|
I am using VB.2013.
Code :
Dim MydataStream As Stream = Nothing
MydataStream = MyWebClient.OpenWrite(address:=MySend2URL, method:="POST")
Dim postArray As Byte() = Encoding.ASCII.GetBytes(postData)
MydataStream.Write(postArray, 0, postArray.Length)
MydataStream.Close()
Dim reader As New StreamReader(MydataStream)
How can I get a response that can be used and not the Stream is not readable error.
|
|
|
|
|
Your previous line of code closed the stream, so how do you expect to read it?
|
|
|
|
|
It also happens if I do not close it.
If postData = NIL Then
MydataStream = MyWebClient.OpenRead(address:=MySend2URL)
Else
MydataStream = MyWebClient.OpenWrite(address:=MySend2URL, method:="POST")
MydataStream.Write(postArray, 0, postArray.Length)
End If
Dim ThisResponse As String = NIL
Dim reader As New StreamReader(MydataStream)
|
|
|
|
|
Your stream is opened for write access, or there is nothing to read. You will need to use your debugger to collect more information.
|
|
|
|
|
What information?
I would think that it would be normal to write and expect a response.
|
|
|
|
|
QuickBooksDev wrote: I would think that it would be normal to write and expect a response. Of course, you are correct. But debugging is what we have to do when our applications do not behave normally.
|
|
|
|
|
I understand that I have been coding for many years but I have never used WebClient before and do not know what to look for. I was expecting that is there is some setting or parameter that needs to be set to get the response.
Do you have any explicit things to look for? Or do you have any code that does something similar that you can provide?
|
|
|
|
|
What kind of response are you expecting to get back from the POST? Is it a file? Just a string? Some kind of value? What?
Using (rs = MyDataStream.GetResponse().GetResponseStream())
Using (reader = New StreamReader(rs))
Dim content = reader.ReadToEnd()
End Using
End Using
This might not compile. I'm translating from C# and I'm really tired right now...
|
|
|
|
|
It doesn't compile. Please send c# code. GetResponse is not a member of io stream and rs not defined. How should MyDataStream and rs be defined?
I am not sure of the response. The doc that I have on this service is very limited and not written for .Net.
|
|
|
|
|
|
|
The doc is where I started and copied the code from their examples. I just does not show getting a response from OpenWrite.
There is very little of my code to actually debug.
I am not sure if I am sending the wrong data to the service or that the WebClient is coded wrong.
|
|
|
|
|
QuickBooksDev wrote: I am not sure if I am sending the wrong data to the service And all i can say in response, once again, is that you need to do some debugging to find out. There is no detail in your question that can help anyone here to guess what might be going wrong.
|
|
|
|
|
If you don't close it the stream will still contain the data that is in the postarray, with the "current position" at the end of the stream. If you want to read it, you'd need to reset the position. Then again, why would you read from the stream the data that you just wrote to it?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I don't want to read from what I wrote. The data I wrote in not in the stream but in postArray.
MydataStream.Write(postArray, 0, postArray.Length)
From the MS example Steam = MyWebClient.OpenWrite(... It was my assumption that this was be a response like it is if it were an OpenRead (which does work).
The MSDN sample doesn't show it processing a response.
|
|
|
|