473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unhandeled execption in PrintPreview

max
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
oJobReport = New PrintDocument
End If
AddHandler oJobReport.PrintPage, AddressOf PrintJobRptPage
AddHandler oJobReport.BeginPrint, AddressOf PrepareJobReport
'AddHandler oJobReport.EndPrint, AddressOf JobReportFini
If bPrintPreview Then
oPreview = New PrintPreviewDialog
oPreview.Document = oJobReport
Try
oPreview.ShowDialog()
Catch ex As Exception
MsgBox("Print Preview Exception" & vbCrLf & ex.ToString())
End Try
....
<SNIP>

Output of the details of the exception, happened on the .ShowDialog() not in
the Catch...
I don't understand the configuration information on the bottom on output.
This is being run in Debug mode, but all you can do is Continue or Ignore.

<OUTPUT from error>

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Windows.Forms.PrintPreviewControl.Calculate PageInfo()
at System.Windows.Forms.Control.InvokeMarshaledCallba cks()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
rrprt_cl
Assembly Version: 1.0.1821.16933
Win32 Version: 1.0.1821.16933
CodeBase:
file:///C:/Documents%20and%20Settings/Max/My%20Documents/Visual%20Studio%20Projects/rrprt/rrprt_cl/bin/rrprt_cl.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

<END of OUTPUT from error>

--
Max
ma*@m99c.com
Nov 21 '05 #1
1 1227
max
Well, it has something to do with:
If oPrinterSetting Is Nothing Then
oPrinterSetting = New PrinterSettings
End If

I don't see how they got associated, but with prior to the
printPreview.showdialog it begins to work. :-)
I wonder why.

Thanks,
max

--
Max
ma*@m99c.com
"max" <xa*******@isomedia.com> wrote in message
news:OX****************@tk2msftngp13.phx.gbl...
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
oJobReport = New PrintDocument
End If
AddHandler oJobReport.PrintPage, AddressOf PrintJobRptPage
AddHandler oJobReport.BeginPrint, AddressOf PrepareJobReport
'AddHandler oJobReport.EndPrint, AddressOf JobReportFini
If bPrintPreview Then
oPreview = New PrintPreviewDialog
oPreview.Document = oJobReport
Try
oPreview.ShowDialog()
Catch ex As Exception
MsgBox("Print Preview Exception" & vbCrLf & ex.ToString())
End Try
...
<SNIP>

Output of the details of the exception, happened on the .ShowDialog() not
in the Catch...
I don't understand the configuration information on the bottom on output.
This is being run in Debug mode, but all you can do is Continue or Ignore.

<OUTPUT from error>

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of
an object.
at System.Windows.Forms.PrintPreviewControl.Calculate PageInfo()
at System.Windows.Forms.Control.InvokeMarshaledCallba cks()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
rrprt_cl
Assembly Version: 1.0.1821.16933
Win32 Version: 1.0.1821.16933
CodeBase:
file:///C:/Documents%20and%20Settings/Max/My%20Documents/Visual%20Studio%20Projects/rrprt/rrprt_cl/bin/rrprt_cl.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

<END of OUTPUT from error>

--
Max
ma*@m99c.com

Nov 21 '05 #2

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

Similar topics

1
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...
1
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....
0
by: sachin | last post by:
When we view any document in print preview dialog, where does it save the document? such that when me move to next/previous page where it reads the information from . If a heavy document like RTF...
11
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...
9
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...
0
by: james | last post by:
While trying to help another programmer on MSDN's Visual Basic 2005 Express Edition forum, he (and I ) ran into a strange problem with the PrintPreview Control in VB2005. If you load a document (...
0
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...
6
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
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
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...

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.