I was able to get this working. If anyone is interested, here is my code:
' Print Orders
Dim j As Integer
Dim row As Integer = e.MarginBounds.Top
For i As Integer = index To lId.Count - 1
e.Graphics.DrawString(lId(i).ToString(), printFont11, Brushes.Black...
He has a staff of programmers. But they have never gotten into .Net. I use my class library, OrderClasses, for their web site. So I spent a lot of time creating this. It's their code, not mine as I developed it for them. They own the source code. I told him it's not a difficult concept to...
Yeah, the IT director at my client is a dinosaur. They are forever stuck in the VB6 world. If you look at my Imports, I have a reference named OrderClasses which contains all my classes with properties, methods, constructors, etc for the order entry system. When the guy saw that, he demanded...
Here is the code for the Orders report. You will notice a lot of variables defined at the top of code. Many are unused for my specific report but are used for the other 4 reports. I left them in for time's sake. Here is the complete code:
Imports System.Configuration
Imports OrdersClasses...
The problem is this client does crazy things like producing 5 different reports from one windows forms program. I am only concerned with this orders report. Let me copy everything over to notepad and then delete the code for the other 4 reports since they work ok. Give me a few minutes.
Herman,
I stepped thru the code several times already but with all my recent changes, I did it again as you suggested. As I step thru this code:
' Print Orders
Dim j As Integer
For j = 0 To lId.Count - 1
e.Graphics.DrawString(lId(j).ToString(), printFont11...
Yeah, I don't like this PrintDocument. Maybe it's just me but it seems strange. And don't forget that I did originally write the code that produced the report without ever using PrintDocument. But now my client it generating hundreds of orders a day which means multiple pages are being...
Yes, I started with .Net with the beta version in 2000. I meant VB6 or whatever number it was in 1996. But along those lines, I have never written a VB.Net windows forms program until now. I can't write it in C# since the client is requiring VB.Net since that is what their staff knows. But...
Ian,
Thanks for the reply. I changed my code like this:
' Print Orders
Do While listIndex <= lId.Count - 1
e.Graphics.DrawString(lId(j).ToString(), printFont11, Brushes.Black, 100, iLine)
e.Graphics.DrawString(lName(j).ToString(), printFont11, Brushes.Black...
Thanks for your reply.
It's not a C# or VB.Net thing for me as I develop using both languages. It's that I have not written a VB.Net windows forms program in 20 years. And I have never done printing like this and I'm pretty much clueless. I always use SQL Server Reporting Services but my...
I'm really a C# web developer who suddenly was assigned a VB.Net Windows forms project. The last time i did VB was the 1990's. I'm struggling with printing using the printdocument control. It works fine if my data fits on one page. But now I have a list of orders that needs to print on 2...
I got it working by putting all my ADO.Net code directly in my form page load event. Not sure why my class file method does not work since it works fine for my web applications.
Sorry for the confusion. No, it's not working. I made that last post since I had a copy / paste error in my original post. But I still cannot get my datagridview control populated from a method that works perfectly for my web application.
I had a copy / paste error I just noticed on my original post. I had the connection string as a parameter when i was building my datatable which would bomb. I fixed the code below:
Imports System.Configuration
Imports OrdersClasses
Public Class Form1
Dim connStringNW As String =...
It's been 19 years since I developed a windows form using VB. I've only done web development since. So I created a windows form and dragged a DataGridView control to my form. I then added 2 columns. I have a class library where I have a function that returns a datatable. This works as I use it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.