I'm using PrintPreviewDialog in vb2005 and it takes 1min to generate report with a single word.. is it vb bug or what? is there anything to make thing faster?
6 1102
Shouldn't you have posted this in the .net Forum???
I'm using PrintPreviewDialog in vb2005 and it takes 1min to generate report with a single word.. is it vb bug or what? is there anything to make thing faster?
Shouldn't you have posted this in the .net Forum???
No its ok here......
in should not be taking so long..... would you mind posting your code
-
Public Class Form1
-
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
-
Dim g As Graphics = e.Graphics
-
Dim message As String = System.Environment.UserName
-
Dim messageFont As New Font("Arial", 24,System.Drawing.GraphicsUnit.Point)
-
g.DrawString(message, messageFont, Brushes.Black, 100, 100)
-
End Sub
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
PrintPreviewDialog1.ShowDialog()
-
End Sub
-
End Class
-
and in PrintPreviewDialog1 properties -document set to PrintDocument1
That also might be because of your system configuration.
none of other programs have problems with that..
printing operation also takes one minute
-
Public Class Form1
-
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
-
Dim g As Graphics = e.Graphics
-
Dim message As String = System.Environment.UserName
-
Dim messageFont As New Font("Arial", 24,System.Drawing.GraphicsUnit.Point)
-
g.DrawString(message, messageFont, Brushes.Black, 100, 100)
-
End Sub
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
PrintPreviewDialog1.ShowDialog()
-
End Sub
-
End Class
-
and in PrintPreviewDialog1 properties -document set to PrintDocument1
ok what i dont like about your code is the dim g as graphics
instead use the with property - Dim message As String = System.Environment.UserName
-
Dim messageFont As New Font("Arial", 24,System.Drawing.GraphicsUnit.Point)
-
with e.graphics
-
.DrawString(message, messageFont, Brushes.Black, 100, 100)
-
End Sub
-
End with
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: alexz |
last post by:
Generating a report
Alexander | Posted 11:05am 31. March 2004 Server Time |
3 Tables
1) Titles - The course titles
2) Courses - The schedules Courses
3) Students - Coueses a Student is...
|
by: Raghavendra |
last post by:
hi,
we r using forms authetication.
problem :- i am using the below code to generate excel report
but since we r using forms authetication.. after generating excel report the
browser directs...
|
by: Rahul Chatterjee |
last post by:
Hello All
I have designed a dotnet application using VB which basically takes a
selection and passes value to a crystal report which in turn passes the
value to a Stored procedure. After the...
|
by: John Smith |
last post by:
Hello, I have 7 different crystal reports that need to be collated.
Since I want to end up with a page of each (which all together make a
single report), I created a blank main report and then...
|
by: lmttag |
last post by:
Hello.
We're developing an ASP.NET 2.0 (C#) application and we're trying to
AJAX-enable it. We're having problem with a page not showing the page while
a long-running process is executing. So,...
|
by: billa856 |
last post by:
Hi,
>I have project in MS access.
>In that project I am generating some reports for my company.
>Now In my form I have one combobox(PalletNo_combo)
>when I select an item from combobox and then...
|
by: Aswanth |
last post by:
I'm Generating Reports in SSRS-2005..
Previously I got the Data from One Database & Generated Reports.. Now I used to get the Data from Two Different Databases(ie Database-1 & Database-2) & to...
|
by: Aswanth |
last post by:
I'm Working with Asp.Net with C#.. & I'm Generating Reports in SSRS-2005..
Till Now I'm Generating Reports in SSRS-2005 with Stored Procedure.. in Which I'm Generating Reports for One...
|
by: veer |
last post by:
hi
i made program in which i am generating the report of a ms-table database
it works fine only on my computer and generatin the reports but when i run this exe on any computer the whole programe...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |