|
What I a trying to do is Print a bunch of text which I get from a text file. I have been able to do that no problem but when I get to the end if there is to much text, I can't get it to go over onto anther page it either just ignores the rest or when it does actually print it it prints it over what I have already done on the same page. I have tried and tried on the e.hasmorepages and it does nothing for me when it actually does some what work it just goes and tries to print XXXX amount of pages instead of just like 2 or 3. I do save my spot of where I last printed on the last page, but it won't start a second page to start printing on that 1. can anyone Please Help Me? Here is a sample of my code, that is to determin when to stop. CurY is the Y location of the Printing Page. QNum is the Number of line so far I have Printed and TotCount is the number of lines I have left to Print
If CurY >= 1000 Then
Hault = True
e.HasMorePages = True
StoppedNum = QNum
End If
If QNum = TotCount Then
e.HasMorePages = False
End If
If there is a better way please let me know! I Thank You for your Time, and Patience!
It is always Coffee Time!
|
|
|
|
|
I've project in VB.net 2005
about: Transelation Programe
so >> I want a code advance and nice for the form output
or any thing nice
I lOve VB & C#
|
|
|
|
|
First, don't call anyone "lover", unless it's your girlfriend.
Next, ... This post doesn't make any sense at all. You might want to try explaining what you want to do and get someone to translate into English for you.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
If this guy isn't trolling, then who is ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know. If it goes anywhere off-topic, if there's EVER a response , he'll get handled and abused like any other troll.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I assume the troll noticed that Indians often call people 'dear', and decided to up the ante...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
please does anybody know any forum or site where i can get information about barcode development in vb.net
leo1
|
|
|
|
|
Try this article: VBScan.
Also, try searching CodeProject for barcode if you need additional help.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi,
I would like to know the best/proper way of handling foreign or special characters between XML, disk file, and XML Soap Reader (UTF-8).
Given that a VB6 program request a XML Soap Web Service. It gets the response and write it to a file using VB6 Open ... as output, print #nn, s....
A VB.NET program then reads this file via XMLTextReader but it fails due to a
'Invalid character in the given encoding'. The character is a 'ü' in München. I am sure there will be more. MSIE cannot read the file either.
So what is the best way to get or write these characters. Hopefully I don't have to check each character.
Thanks
|
|
|
|
|
|
I got a page not found on both links.
I assume yours was about CDATA but the first only gave me some code and no real discussion so I am not sure where to go from here.
Help!
|
|
|
|
|
I guess my suggestion would be on the fields you know have special charaters use the base64encode before you put the item into the xml file. Then on the other end you will decode that field when you put it out. I just showed you my example of doing this with a cdata node which is more complicated then you need to do. Encoding the field will take care of the characters that are causing you problems.
Ben
|
|
|
|
|
So I have to check every character for all the special characters??? The first article does an encoding for every byte for email, etc. Is that the right article?
It seems strange that if I get a XML block in from Web Services that I would have to encode it to be viewed by an XML program like either MSIE or my XMLTestReader program.
I think that I just do not understand what is going on.
I am assuming that if the XML block comes in as UTF-8 that the ü is OK as is. So does it change when I write it to disk. I can still see a ü in the file but MSIE doesn't like it.
What am I missing?
|
|
|
|
|
Ok, I see your problem. Your default encoding for when you write the file to disk is most likely not UTF-8. That perhaps is the direction you need to be going. I was encoding my stuff because I was stuffing xml inside of a cdata node of a soap message which is also xml. If I didn't encode it, it just would work.
I actually remember running into a similar problem. If you look at your code with whatever stream you are using to write out the xml file, one of the overloaded options will include passing in the encoding. I would suggest that you pass that in as UTF-8 and it very may well fix your problem.
Ben
|
|
|
|
|
UTF-8 is not an option in VB6 that I can know. It's either Unicode (UTF-16) or the default (ASCII).
|
|
|
|
|
vb.net supports the encoding. That is where you are getting the error anyway correct? So you may need to change the streamreader that you are using so that it is utf-8 encoding in vb.net
Ben
|
|
|
|
|
The error occurs even when MSIE tries to open the file indicating that either the file was written bad or the data came in bad. The .net program fails when 'reading' the file in XMLTextReader. It is already to late by then.
|
|
|
|
|
If you have the correct encoding it seems like this should work. I think you need to try to write out whatever encoding that is support in vb6 that supports these characters and then read it in with that same encoding in vb.net
Ben
|
|
|
|
|
After I write it I usually let MSIE try to read it. If MSIE can't then my VB.NET will probably fail as well.
I can write is as Unicode. But MSIE will not be able to read it unless I change
encoding="utf-8"? to utf-16.
But this doesn't seem to be right. I would think that there should be an easier way just to write an XML block to disk without all the fuss.
Question: When the accented character is read from Web Services in VB6 the data looks and displays fine (the ü looks like a u with 2 dots). It is also written do disk and it still looks fine with Notepad. Then why is it that MSIE stops with an Invalid Character on ü. Is the enocoding in utf-8 different from ASCII.
What am I missing?
|
|
|
|
|
UTF-8 is different the ascii. Are you sure it is the ü that is causing your xml file to fail? Perhaps you are having other issues? If you want to send the bad xml file to me, you can sent it to ben.kubicek@netzero.com
Ben
|
|
|
|
|
Yes, I am sure. If I change the character to a normal u with notepad it works fine. I cannot send the file since it has customer info in it. But I removed all the data and created a small file with just 1 tag.
<?xml version="1.0" encoding="utf-8"?>
<tag>München</tag>
And MSIE fail on it. I will send the file via email also.
So this is saying that when I read the data from web services that the ü is now ASCII? Or when it is written to disk it is change to ASCII?
|
|
|
|
|
I put that text into a file called test.xml
I could open in it xmlspy with no issues or errors
I could run this code:
Dim doc As New XmlDocument()
doc.Load("c:\temp\test.xml")
again no issues or errors.
What is the exact error message you are getting again?
Ben
|
|
|
|
|
In MSIE
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
An invalid character was found in text content. Error processing resource 'file:///N:/accnt/CustomerFiles/MasterPiece/Err/x...
<tag>M
In VB.NET (using the real (big) file).
Invalid character in the given encoding. Line 63, position 2.
|
|
|
|
|
I think the issue in vb.net has to do with how you are reading the file.
what does your code look like?
Ben
|
|
|
|
|
The actual instruction is
Dim XRsave As XmlTextReader
XR = New XmlTextReader(TheFFn)
.
.
While (XR.Read())
I loops until it gets the the bad tag.
If it where vb.net then why can't MSIE read the file????
|
|
|
|