473,657 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent PrintPreview Error?

Hi,

I am using .Net Framework 2.0 final, and i use .Net printing library to
print a document. I use printPreview dialog to print the document but after
preview was shown, when i press the "print" button, i cannot print the
document although there is some words on the preview. So, is there a bug in
the preview?

Thanks...
Jan 2 '06 #1
9 3804
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:uu******** ******@TK2MSFTN GP14.phx.gbl...

I am using .Net Framework 2.0 final, and i use .Net printing library to
print a document. I use printPreview dialog to print the document but after preview was shown, when i press the "print" button, i cannot print the
document although there is some words on the preview. So, is there a bug in the preview?


did you detach the PrintDocument events?

Do you get an exception or the document simply is not printed?

--
Free .Net Reporting tool: http://www.neodatatype.net
Jan 2 '06 #2
Hi,

My code is on the below,

m_PrintDocument = new PrintDocument( );
m_PrintDocument .PrintPage += new PrintPageEventH andler(
m_PrintDocument _PrintPage );
PrintPreviewDia log printPreviewDia log1 = new PrintPreviewDia log ( );
printPreviewDia log1.Document = m_PrintDocument ;
Form m_Temp = ( Form ) printPreviewDia log1;
m_Temp.WindowSt ate = FormWindowState .Maximized;
printPreviewDia log1.ShowDialog ( );

void m_PrintDocument _PrintPage( object sender, PrintPageEventA rgs e )
{
Font printFont = new Font ( "Courier" , 10 , FontStyle.Regul ar );
String myString = "Trying";
e.Graphics.Draw String( myString, printFont, Brushes.Black, 0, 0, new
StringFormat( ) );
}

"Zanna" <zn*******@virg ilio.it> wrote in message
news:43******** **************@ reader3.news.ti n.it...
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:uu******** ******@TK2MSFTN GP14.phx.gbl...

I am using .Net Framework 2.0 final, and i use .Net printing library to
print a document. I use printPreview dialog to print the document but

after
preview was shown, when i press the "print" button, i cannot print the
document although there is some words on the preview. So, is there a bug

in
the preview?


did you detach the PrintDocument events?

Do you get an exception or the document simply is not printed?

--
Free .Net Reporting tool: http://www.neodatatype.net

Jan 2 '06 #3
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:e5******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

My code is on the below,


[Snip]
This works perfect to me:
class Printer {

public void Print()

{

PrintDocument m_PrintDocument = new PrintDocument() ;

m_PrintDocument .PrintPage += new
PrintPageEventH andler(m_PrintD ocument_PrintPa ge);

PrintPreviewDia log printPreviewDia log1 = new PrintPreviewDia log();

printPreviewDia log1.Document = m_PrintDocument ;

Form m_Temp = (Form)printPrev iewDialog1;

m_Temp.WindowSt ate = FormWindowState .Maximized;

printPreviewDia log1.ShowDialog ();

}

void m_PrintDocument _PrintPage( object sender, PrintPageEventA rgs e )

{

Font printFont = new Font ( "Courier" , 10 , FontStyle.Regul ar );

String myString = "Trying";

e.Graphics.Draw String( myString, printFont, Brushes.Black, 0, 0, new

StringFormat( ) );

}

}
--
Free .Net Reporting tool: http://www.neodatatype.net
Jan 2 '06 #4
Hi,

I think so, but i cannot use the printpreview print button to print the
document. It gives me an empty page although there is some words in the
document. It works fine before i installed .Net 2.0 final. Is it about
framework?

"Zanna" <zn*******@virg ilio.it> wrote in message
news:43******** **************@ reader3.news.ti n.it...
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:e5******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

My code is on the below,


[Snip]
This works perfect to me:
class Printer {

public void Print()

{

PrintDocument m_PrintDocument = new PrintDocument() ;

m_PrintDocument .PrintPage += new
PrintPageEventH andler(m_PrintD ocument_PrintPa ge);

PrintPreviewDia log printPreviewDia log1 = new PrintPreviewDia log();

printPreviewDia log1.Document = m_PrintDocument ;

Form m_Temp = (Form)printPrev iewDialog1;

m_Temp.WindowSt ate = FormWindowState .Maximized;

printPreviewDia log1.ShowDialog ();

}

void m_PrintDocument _PrintPage( object sender, PrintPageEventA rgs e )

{

Font printFont = new Font ( "Courier" , 10 , FontStyle.Regul ar );

String myString = "Trying";

e.Graphics.Draw String( myString, printFont, Brushes.Black, 0, 0,
new

StringFormat( ) );

}

}
--
Free .Net Reporting tool: http://www.neodatatype.net

Jan 2 '06 #5
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:e6******** ******@TK2MSFTN GP14.phx.gbl...
I think so, but i cannot use the printpreview print button to print the
document. It gives me an empty page although there is some words in the
document. It works fine before i installed .Net 2.0 final. Is it about
framework?


I used the code I wrote with VS.Net 2005, so, against fw 2.0 final.

Did you tryied my code (that, after all is your) simply using:

Printer p = new Printer();
p.Print();

?

When I print the page it is printed correctly.

--
Free .Net Reporting tool: http://www.neodatatype.net
Jan 2 '06 #6
Hi,

Do you think that it is the solution? I think it cannot be accepted that the
print button of the printpreview form is not working although there are
words on the document. Is it a bug? The printpreview dialog must print the
document. What do you think really i wonder about it?
Thanks...
"Zanna" <zn*******@virg ilio.it> wrote in message
news:43******** **************@ reader3.news.ti n.it...
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:e6******** ******@TK2MSFTN GP14.phx.gbl...
I think so, but i cannot use the printpreview print button to print the
document. It gives me an empty page although there is some words in the
document. It works fine before i installed .Net 2.0 final. Is it about
framework?


I used the code I wrote with VS.Net 2005, so, against fw 2.0 final.

Did you tryied my code (that, after all is your) simply using:

Printer p = new Printer();
p.Print();

?

When I print the page it is printed correctly.

--
Free .Net Reporting tool: http://www.neodatatype.net

Jan 2 '06 #7
"Adam Right" <ad**@right.com > ha scritto nel messaggio
news:uU******** *****@TK2MSFTNG P10.phx.gbl...

Do you think that it is the solution? I think it cannot be accepted that the print button of the printpreview form is not working although there are
words on the document.


I really don't understand.
The code I posted is working or not?

If it is working where is the problem?

--
Free .Net Reporting tool: http://www.neodatatype.net
Jan 2 '06 #8
The problem is not that the document will not print correctly.

The problem is that using the Print... menu item from
PrintPreviewDia log causes it to be printed _twice_: once to display in
the print preview, then again to print on the printer. The document is
not printing properly the second time, when PrintPreviewDia log tries to
print it again to the printer.

So, your test is inadequate: you are only trying to print the document
once, using .Print().

We have another thread going on this problem. I suggest that we abandon
this discussion and concentrate on that other thread.

Jan 2 '06 #9
Hi,

Ok, i can use Print() function to print the document but i have to show the
documents that will be printed to the user. The reason is that user may or
not print the document he/she has to see the document. So by using Print()
function how can i show the print document either?
Thanks...

"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
The problem is not that the document will not print correctly.

The problem is that using the Print... menu item from
PrintPreviewDia log causes it to be printed _twice_: once to display in
the print preview, then again to print on the printer. The document is
not printing properly the second time, when PrintPreviewDia log tries to
print it again to the printer.

So, your test is inadequate: you are only trying to print the document
once, using .Print().

We have another thread going on this problem. I suggest that we abandon
this discussion and concentrate on that other thread.

Jan 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2014
by: LARB | last post by:
Good morning, I have a print routine where I use a "printpreview dialog' control. The text is perfect BUT when I then print the job all the text is completely crazy, a bit like "wingdings".
1
2014
by: Randy | last post by:
Hello, I'm trying to print a simple string using the PrintPreviewDialog. I get the string to show up in the PrintPreview dialog, but when I click the Printer icon, it just prints a blank page. There's something I'm doing wrong. Can someone give me some code to print a simple string in the PrintPreview dialog box? Thanks
16
2928
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
1
1239
by: max | last post by:
Is this a framework question? vs a VB.Net question? I'm getting an unhandled exception in oPreview that isn't caught by the Try. Any ideas on how surround this puppy?? <SNIP> Dim oPreview As PrintPreviewDialog .... If oJobReport Is Nothing Then
11
2356
by: Adam Right | last post by:
Hi, I am using .Net Framework 2.0 final, and i use .Net printing library to print a document. I use printPreview dialog to print the document but after preview was shown, when i press the "print" button, i cannot print the document although there is some words on the preview. So, is there a bug in the preview? Thanks...
0
1924
by: Joxie | last post by:
Hi, All! Recently I'm using ultrawebgrid for my projects... While I try Ultragrid (for windows application) I could call printpreview as ultragrid function, but while I'm using Ultrawebgrid (for asp.net/web application) I can't find the printpreview... So, the question is: Is there a way for me to use printpreview for Ultrawebgrid (just like when I'm using UltraGrid)? Note: 1. UltraGrid & UltraWebGrid are components from Infragistics.
6
1471
by: Stuart Nathan | last post by:
Can someone tell me how to remove a previously loaded PrintDocument in a PrintPreview control, so that I can display a nedw one?
2
2103
by: eBob.com | last post by:
I have a print application modeled on a program which I found via this newsgroup. (I still have comments in German in it!) The model uses ExtendedPrintPreviewDialog but I don't seem to have that so I am using PrintPreviewDialog. It prints fine. But the PrintPreview dialog shows only one blank page. Before I resort to posting code, is there some simple and/or common mistake I could have made which would explain why PrintPreview shows...
0
1106
by: vench | last post by:
Hi! I have a vb.net project that uses mozilla activeX control, there is no problem in navigating or loading the url in the control, the problem that I have encountered is when printpreview using the code axWebbrowser1.exeWB(MOZILLACONTROLLib.OLECMDID.OLECMDID_PRINTPREVIEW, MOZILLACONTROLLib.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER) I get an innerException error something on reflection... I don't know how to fix it... thanks....
0
8407
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.