473,387 Members | 1,619 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.

Print Preview Error

hi,

I am intermediate in programming and i am getting error on print preview command in my program.
Actually i had made a website using vb.net code. and i have a DailyUpdateReport.aspx page. in that i putted one image button and on image button i putted the code below..
Expand|Select|Wrap|Line Numbers
  1. Private Sub ImagebuttonPP_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImagebuttonPP.Click
  2.         Try
  3.             Dim oStringWriter As New System.IO.StringWriter
  4.             Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)
  5.             'Dim oHtmlTextWriter As New System.Xml.XmlTextWriter(oStringWriter)
  6.             Response.Clear()
  7.             Response.Buffer = True
  8.             Response.ContentType = "application/pdf"
  9.             Response.Charset = ""
  10.             Me.EnableViewState = False
  11.             DG1.RenderControl(oHtmlTextWriter)
  12.             Response.Write(oStringWriter.ToString())
  13.             Response.End()
  14.         Catch ex As Exception
  15.             lblErr.Visible = True
  16.             lblErr.Text = ex.Message
  17.         End Try
  18.     End Sub
before few months its working fine and opening the that aspx page as on print preview in pdf. but now its giving error
' File does not begin with %pdf- '
I am using a Adobe Reader 9, version 9.3.2
and Internet Explorer 8
i don't know what is the problem. and how to resolve the problem.
can anyone knows the solution than please help out.
if u r not understand anything on problem then let me know to explain.
its very urgent.

Thanks
Ishtiyaque.
May 20 '10 #1
0 1097

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
3
by: Bob Darlington | last post by:
When I press F1 in print preview, I get the following error message for some (but not all) reports: 'The expression on Key Down you entered as the event property setting, produced the following...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
1
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
0
by: John | last post by:
I have a class that creates an AxWebBrowser object in the background, loads some arbitrary html content, then shows the user a print preview. The only problem is, this print preview is a tiny...
2
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
9
by: igotyourdotnet | last post by:
I need to create a print preview page BUT my page I need to print has a grid and in the grid I have 2 or 3 columns that have links I want to hide the columns with the links on my print preview page...
5
by: maminx | last post by:
hello all, i want to call window print preview (in browser, File - Print Preview) by javascript, this is the code function printpreview() { var OLECMDID = 7; /* OLECMDID values: * 6...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
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,...

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.