Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,i'm posting question for first time so if i dnt follow any threads or any mistake please excuse me...

Im getting this error in my code:
"Object reference not set to an instance of an object."

Here is my code:

C#
 void document_PrintPage(object sender, PrintPageEventArgs e)
        {
            
            e.Graphics.DrawImage(_memoryImage, 0, 0);

        }
        private Bitmap _memoryImage;

        private void CaptureScreen()
        {
            // put into using construct because Graphics objects do not 
            //  get automatically disposed when leaving method scope
            using (var myGraphics = CreateGraphics())
            {
                var s = Size;
                _memoryImage = new Bitmap(1500, 1000, myGraphics);
                using (var memoryGraphics = Graphics.FromImage(_memoryImage))
                {
                    printDocument2.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("PaperA4", 826, 1169);
                    memoryGraphics.CopyFromScreen(Location.X, Location.Y, 70, 30, s);
                }
            }
        }

        private void printDocument2_PrintPage(object sender, PrintPageEventArgs e)
        {
             //calculate width and height scalings taking page margins into account
            var wScale = e.MarginBounds.Width / (float)_memoryImage.Width;
            var hScale = e.MarginBounds.Height / (float)_memoryImage.Height;

            // choose the smaller of the two scales
            var scale = wScale < hScale ? wScale : hScale;

            // apply scaling to the image
            e.Graphics.ScaleTransform(scale, scale);

            // print to default printer's page
            e.Graphics.DrawImage(_memoryImage, 70, 30);
            printDocument2.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("PaperA4", 826, 1169);
        }
private void btnprintpre_Click(object sender, EventArgs e)
        {
            //Associate PrintPreviewDialog with PrintDocument.
            printPreviewDialog1.Document = printDocument2;

            // Show PrintPreview Dialog
            //printPreviewDialog1.ShowDialog();

            printPreviewDialog1.WindowState = FormWindowState.Maximized;
            printPreviewDialog1.ShowDialog();
        }


And i'm getting near "var wScale = e.MarginBounds.Width / (float)_memoryImage.Width;"

So if anyone has come across this error or can solve my problem please help me.
Posted

e.MarginBounds.Width or (float)_memoryImage.Width is returning null to the statement thats why you have error
 
Share this answer
 
Comments
Bernhard Hiller 26-Mar-14 7:12am    
Look at the variables again. Which ones can be null?
e, e.MarginBounds, memoryImage: they are reference types
but surely not
e.MarginBounds.Width or _memoryImage.Width: they are value types.
debug your code and check whether _memoryImage variable is assigned some value or not.

Its a good practice to check for object value before using its properties.

like

if(_memoryImage != null)
{
//write your whole code here
}
 
Share this answer
 
<solved>
My problem got solved by changing the normal buttons to menu buttons and putting the code in it but i'm facing another error now,

Here is my complete code:
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing.Printing;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Timers;

namespace ComplaintReport
{
    public partial class MRU240 : Form
    {

        private PrintPreviewDialog Pv;
        private PageSetupDialog Ps;
        private PrintDocument Pd;
        private PrintDialog Pr;

        private System.Windows.Forms.MainMenu mainMenu1;
        private System.Windows.Forms.MenuItem mnuFile;
        private System.Windows.Forms.MenuItem mnuSetup;
        private System.Windows.Forms.MenuItem mnuPreview;
        private System.Windows.Forms.MenuItem mnuPrint;
        private System.Windows.Forms.Button cmdQuit;

         public MRU240()
        {
            InitializeComponent();

            Pv = new PrintPreviewDialog();
            Ps = new PageSetupDialog();
            Pr = new PrintDialog();
            Pd = new PrintDocument();

            Pd.DocumentName = "My New Document";
            Pv.Document = Pd;
            Ps.Document = Pd;
            Pr.Document = Pd;
        }


       
        private void clearAll()
        {
            txt1.Text = "";
            txtsno.Text = "";
            txt3.Text = "";
            txt4.Text = "";
            txt5.Text = "";
            txt6.Text = "";
            txt7.Text = "";
            txt8.Text = "";
            txt9.Text = "";
            txt11.Text = "";
            txt12.Text = "";
            txt13.Text = "";
            txt14.Text = "";
            txt15.Text = "";
            txt16.Text = "";
            txt17.Text = "";
            txt18.Text = "";
            txt19.Text = "";
            txt20.Text = "";
       
        }
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            clearAll();
        
            btnedit.Visible = false;
            btnupdate.Visible = false;
            txt1.Visible = true;
            txt2.Visible = true;
            txtsno.Visible = true;
            txt3.Visible = true;
            txt4.Visible = true;
            txt5.Visible = true;
            txt6.Visible = true;
            txt7.Visible = true;
            txt8.Visible = true;
            txt9.Visible = true;
            txt11.Visible = true;
            txt12.Visible = true;
            txt13.Visible = true;
            txt14.Visible = true;
            txt15.Visible = true;
            txt16.Visible = true;
            txt17.Visible = true;
            txt18.Visible = true;
            txt19.Visible = true;
            txt20.Visible = true;
            lbluno.Visible = false;
            label1.Visible = true;
            label2.Visible = true;
            label3.Visible = true;
            label4.Visible = true;
            label5.Visible = true;
            label6.Visible = true;
            label7.Visible = true;
            label8.Visible = true;
            label9.Visible = true;
            label10.Visible = true;
            label11.Visible = true;
            label12.Visible = true;
            label13.Visible = true;
            label14.Visible = true;
            label15.Visible = true;
            label16.Visible = true;
            label17.Visible = true;
            label18.Visible = true;
            label19.Visible = true;
            label21.Visible = true;
            label22.Visible = true;
            label23.Visible = true;
            label25.Visible = true;
            btnexit.Visible = true;
            comboBox1.Visible = false;

            txt1.ReadOnly = false;
            txt3.ReadOnly = false;
            txt4.ReadOnly = false;
            txt5.ReadOnly = false;
            txt6.ReadOnly = false;
            txt7.ReadOnly = false;
            txt8.ReadOnly = false;
            txt9.ReadOnly = false;
            txt11.ReadOnly = false;
            txt12.ReadOnly = false;
            txt13.ReadOnly = false;
            txt14.ReadOnly = false;
            txt15.ReadOnly = false;
            txt16.ReadOnly = false;
            txt17.ReadOnly = false;
            txt18.ReadOnly = false;
            txt19.ReadOnly = false;
            txt20.ReadOnly = false;
            txtsno.ReadOnly = false;
            txt2.ReadOnly = true;
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string cs = "Data Source=192.168.1.133;database=ComplaintReport;user id=sa;password=ssdrnd";
            SqlConnection conn = new SqlConnection(cs);
            SqlCommand cmd = new SqlCommand();
            conn.Open();
           
            SqlDataAdapter da = new SqlDataAdapter("select Mno from MRU240", conn);
            DataSet ds = new DataSet();
            cmd = new SqlCommand("select Mno from MRU240", conn);
            da.Fill(ds, "mru240");

            comboBox1.DataSource = ds.Tables["mru240"];
            comboBox1.DisplayMember = "Mno";
            conn.Close();
           
            //btnprint.Visible = true;
            
            comboBox1.Visible = true;
            lbluno.Visible = true;
            btnupdate.Visible = false;
            txt1.Visible = false;
            txt2.Visible = false;
            txtsno.Visible = false;
            txt3.Visible = false;
            txt4.Visible = false;
            txt5.Visible = false;
            txt6.Visible = false;
            txt7.Visible = false;
            txt8.Visible = false;
            txt9.Visible = false;
            txt11.Visible = false;
            txt12.Visible = false;
            txt13.Visible = false;
            txt14.Visible = false;
            txt15.Visible = false;
            txt16.Visible = false;
            txt17.Visible = false;
            txt18.Visible = false;
            txt19.Visible = false;
            txt20.Visible = false;
            label3.Visible = false;
            label2.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            label6.Visible = false;
            label7.Visible = false;
            label8.Visible = false;
            label9.Visible = false;
            label10.Visible = false;
            label11.Visible = false;
            label12.Visible = false;
            label13.Visible = false;
            label14.Visible = false;
            label15.Visible = false;
            label16.Visible = false;
            label17.Visible = false;
            label18.Visible = false;
            label19.Visible = false;
            label21.Visible = false;
            label22.Visible = false;
            label23.Visible = false;
            label25.Visible = false;
            btnedit.Visible = false;
            
            btnexit.Visible = false;

        }

      
        private void toolStripMenuback_Click(object sender, EventArgs e)
        {
            SSCVR obj6 = new SSCVR();
            obj6.Show();
            this.Hide();
        }
       

        private void MRU240_Load(object sender, EventArgs e)
        {
            comboBox1.DropDownHeight = comboBox1.ItemHeight * 10;
            comboBox1.MouseWheel += new MouseEventHandler(comboBox1_MouseWheel);
   
            txt1.Visible = false;
            txt2.Visible = false;
            txtsno.Visible = false;
            txt3.Visible = false;
            txt4.Visible = false;
            txt5.Visible = false;
            txt6.Visible = false;
            txt7.Visible = false;
            txt8.Visible = false;
            txt9.Visible = false;
            txt11.Visible = false;
            txt12.Visible = false;
            txt13.Visible = false;
            txt14.Visible = false;
            txt15.Visible = false;
            txt16.Visible = false;
            txt17.Visible = false;
            txt18.Visible = false;
            txt19.Visible = false;
            txt20.Visible = false;
            txtsno.Visible = false;
            comboBox1.Visible = false;
            label2.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            label6.Visible = false;
            label7.Visible = false;
            label8.Visible = false;
            label9.Visible = false;
            label10.Visible = false;
            label11.Visible = false;
            label12.Visible = false;
            label13.Visible = false;
            label14.Visible = false;
            label15.Visible = false;
            label16.Visible = false;
            label17.Visible = false;
            label18.Visible = false;
            label19.Visible = false;
            label21.Visible = false;
            label22.Visible = false;
            label23.Visible = false;
            label25.Visible = false;
            label13.Visible = false;
            label3.Visible = false;
            btnupdate.Visible = false;
            btnexit.Visible = false;

        }
        void comboBox1_MouseWheel(object sender, MouseEventArgs e)
        {
            ((HandledMouseEventArgs)e).Handled = true;
        }
        


        private void btnexit_Click(object sender, EventArgs e)
        {
            SSCVRGSE obj4 = new SSCVRGSE();
            obj4.Show();
            this.Hide();
        }



        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string cs = "Data Source=192.168.1.133;database=ComplaintReport;user id=sa;password=ssdrnd";
            SqlConnection conn = new SqlConnection(cs);
            if (txtsno.Text == "")
            {
                MessageBox.Show("Please enter serial number");
                txtsno.Focus();
            }
            if (txtsno.Text.Length >= 7)
            {
                MessageBox.Show("Serial number below 7 charachters ");
                txtsno.Focus();
            }


            try
            {
                string cfd = txt1.Text;
                string Uno = txt2.Text;
                string Mno = txtsno.Text;
                string cprc = txt3.Text;
                string sdc = txt4.Text;
                string contact = txt5.Text;
                string orderno = txt6.Text;
                string ino = txt7.Text;
                string consig = txt8.Text;
                string pft = txt9.Text;
                string remarks = txt11.Text;
                string obsv = txt12.Text;
                string disptach = txt13.Text;
                string repair = txt14.Text;
                string cause = txt15.Text;
                string userinfo = txt16.Text;
                string remedial = txt17.Text;
                string feedbck = txt18.Text;
                string conclu = txt19.Text;
                string notes = txt20.Text;
           
                SqlCommand cmd = new SqlCommand("insert into MRU240 values(@cfd,@Uno,@Mno,@cprc,@sdc,@contact,@orderno,@ino,@consig,@pft,@remarks,@obsv,@dispatch,@repair,@cause,@userinfo,@remedial,@feedbck,@conclu,@notes)", conn);
                cmd.Parameters.AddWithValue("@cfd", cfd);
                cmd.Parameters.AddWithValue("@Uno", Uno);
                cmd.Parameters.AddWithValue("@Mno", Mno);
                cmd.Parameters.AddWithValue("@cprc", cprc);
                cmd.Parameters.AddWithValue("@sdc", sdc);
                cmd.Parameters.AddWithValue("@contact", contact);
                cmd.Parameters.AddWithValue("@orderno", orderno);
                cmd.Parameters.AddWithValue("@ino", ino);
                cmd.Parameters.AddWithValue("@consig", consig);
                cmd.Parameters.AddWithValue("@pft", pft);
                cmd.Parameters.AddWithValue("@remarks", remarks);
                cmd.Parameters.AddWithValue("@obsv", obsv);
                cmd.Parameters.AddWithValue("@dispatch", disptach);
                cmd.Parameters.AddWithValue("@repair", repair);
                cmd.Parameters.AddWithValue("@cause", cause);
                cmd.Parameters.AddWithValue("@userinfo", userinfo);
                cmd.Parameters.AddWithValue("@remedial", remedial);
                cmd.Parameters.AddWithValue("@feedbck", feedbck);
                cmd.Parameters.AddWithValue("@conclu", conclu);
                cmd.Parameters.AddWithValue("@notes", notes);

                conn.Open();
                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                {
                    MessageBox.Show("Record is saved ");
                    clearAll();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            conn.Close();

        }

        private void btnedit_Click_1(object sender, EventArgs e)
        {
            txt1.ReadOnly = false;
            lbluno.Visible = true;
            txt3.ReadOnly = false;
            txt4.ReadOnly = false;
            txt5.ReadOnly = false;
            txt6.ReadOnly = false;
            txt7.ReadOnly = false;
            txt8.ReadOnly = false;
            txt9.ReadOnly = false;
            txt11.ReadOnly = false;
            txt12.ReadOnly = false;
            txt13.ReadOnly = false;
            txt14.ReadOnly = false;
            txt15.ReadOnly = false;
            txt16.ReadOnly = false;
            txt17.ReadOnly = false;
            txt18.ReadOnly = false;
            txt19.ReadOnly = false;
            txt20.ReadOnly = false;
            txtsno.ReadOnly = true;
            label13.Visible = true;
            btnupdate.Visible = true;
        }

        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            btnupdate.Visible = false;
            btnedit.Visible = true;
            txt1.Visible = true;
            txt2.Visible = true;
            txtsno.Visible = true;
            txt3.Visible = true;
            txt4.Visible = true;
            txt5.Visible = true;
            txt6.Visible = true;
            txt7.Visible = true;
            txt8.Visible = true;
            txt9.Visible = true;
            txt11.Visible = true;
            txt12.Visible = true;
            txt13.Visible = true;
            txt14.Visible = true;
            txt15.Visible = true;
            txt16.Visible = true;
            txt17.Visible = true;
            txt18.Visible = true;
            txt19.Visible = true;
            txt20.Visible = true;
            label2.Visible = true;
            label4.Visible = true;
            label5.Visible = true;
            label6.Visible = true;
            label7.Visible = true;
            label8.Visible = true;
            label9.Visible = true;
            label10.Visible = true;
            label11.Visible = true;
            label12.Visible = true;
            label13.Visible = true;
            label14.Visible = true;
            label15.Visible = true;
            label16.Visible = true;
            label17.Visible = true;
            label18.Visible = true;
            label19.Visible = true;
            label21.Visible = true;
            label22.Visible = true;
            label23.Visible = true;
            label25.Visible = true;
            label3.Visible = true;
            txtsno.Visible = true;
            btnexit.Visible = true;
            comboBox1.Visible = true;
            txt1.ReadOnly = true;
            txtsno.Visible = true;
            txt3.ReadOnly = true;
            txt4.ReadOnly = true;
            txt5.ReadOnly = true;
            txt6.ReadOnly = true;
            txt7.ReadOnly = true;
            txt8.ReadOnly = true;
            txt9.ReadOnly = true;
            txt11.ReadOnly = true;
            txt12.ReadOnly = true;
            txt13.ReadOnly = true;
            txt14.ReadOnly = true;
            txt15.ReadOnly = true;
            txt16.ReadOnly = true;
            txt17.ReadOnly = true;
            txt18.ReadOnly = true;
            txt19.ReadOnly = true;
            txt20.ReadOnly = true;
            txtsno.ReadOnly = true;

            string cs = "server=192.168.1.133;database=ComplaintReport;user id=sa;password=ssdrnd";
            SqlConnection conn = new SqlConnection(cs);
            SqlCommand cmd = new SqlCommand();
            try
            {
                conn.Open();
                int dbsno = int.Parse(comboBox1.Text);

                cmd = new SqlCommand("select * from MRU240 where Mno=@dbsno", conn);
                cmd.Parameters.AddWithValue("@dbsno", dbsno);
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    txt1.Text = dr["cfd"].ToString();
                    txt2.Text = dr["Uno"].ToString();
                    txtsno.Text = dr["Mno"].ToString();
                    txt3.Text = dr["cprc"].ToString();
                    txt4.Text = dr["sdc"].ToString();
                    txt5.Text = dr["contact"].ToString();
                    txt6.Text = dr["orderno"].ToString();
                    txt7.Text = dr["ino"].ToString();
                    txt8.Text = dr["consignee"].ToString();
                    txt9.Text = dr["pft"].ToString();
                    txt12.Text = dr["observation"].ToString();
                    txt13.Text = dr["dispatch"].ToString();
                    txt14.Text = dr["repair"].ToString();
                    txt15.Text = dr["cause"].ToString();
                    txt16.Text = dr["userinfo"].ToString();
                    txt17.Text = dr["remedial"].ToString();
                    txt18.Text = dr["feedback"].ToString();
                    txt19.Text = dr["conclusion"].ToString();
                    txt20.Text = dr["notes"].ToString();
                    txt11.Text = dr["remarks"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            conn.Close();
        }

        private void btnupdate_Click_1(object sender, EventArgs e)
        {
            string cs = "Data Source=192.168.1.133;database=ComplaintReport;user id=sa;password=ssdrnd";
            SqlConnection conn = new SqlConnection(cs);

            string cfd = txt1.Text;
            string Uno = txt2.Text;
            string Mno = txtsno.Text;
            string cprc = txt3.Text;
            string sdc = txt4.Text;
            string contact = txt5.Text;
            string orderno = txt6.Text;
            string ino = txt7.Text;
            string consig = txt8.Text;
            string pft = txt9.Text;
            string remarks = txt11.Text;
            string obsv = txt12.Text;
            string disptach = txt13.Text;
            string repair = txt14.Text;
            string cause = txt15.Text;
            string userinfo = txt16.Text;
            string remedial = txt17.Text;
            string feedbck = txt18.Text;
            string conclu = txt19.Text;
            string notes = txt20.Text;
            int dbsno = int.Parse(comboBox1.Text);
            SqlCommand cmd = new SqlCommand("update MRU240 set cfd=@cfd,Uno=@Uno,cprc=@cprc,sdc=@sdc,contact=@contact,orderno=@orderno,ino=@ino,consignee=@consig,pft=@pft,remarks=@remarks,observation=@obsv,dispatch=@dispatch,repair=@repair,cause=@cause,userinfo=@userinfo,remedial=@remedial,feedback=@feedbck,conclusion=@conclu,notes=@notes where Mno=@dbsno", conn);
            cmd.Parameters.AddWithValue("@cfd", cfd);
            cmd.Parameters.AddWithValue("@Uno", Uno);
            cmd.Parameters.AddWithValue("@Mno", Mno);
            cmd.Parameters.AddWithValue("@cprc", cprc);
            cmd.Parameters.AddWithValue("@sdc", sdc);
            cmd.Parameters.AddWithValue("@contact", contact);
            cmd.Parameters.AddWithValue("@orderno", orderno);
            cmd.Parameters.AddWithValue("@ino", ino);
            cmd.Parameters.AddWithValue("@consig", consig);
            cmd.Parameters.AddWithValue("@pft", pft);
            cmd.Parameters.AddWithValue("@remarks", remarks);
            cmd.Parameters.AddWithValue("@obsv", obsv);
            cmd.Parameters.AddWithValue("@dispatch", disptach);
            cmd.Parameters.AddWithValue("@repair", repair);
            cmd.Parameters.AddWithValue("@cause", cause);
            cmd.Parameters.AddWithValue("@userinfo", userinfo);
            cmd.Parameters.AddWithValue("@remedial", remedial);
            cmd.Parameters.AddWithValue("@feedbck", feedbck);
            cmd.Parameters.AddWithValue("@conclu", conclu);
            cmd.Parameters.AddWithValue("@notes", notes);
            cmd.Parameters.AddWithValue("@dbsno", dbsno);
          
            conn.Open();
            int i = (int)cmd.ExecuteNonQuery();
            if (i >= 1)
            {
                MessageBox.Show("Record is updated ");
                clearAll();
                txt2.Text = "";
            }
            else
            {
                MessageBox.Show("Record is not updated");
            }
            conn.Close();
        }
       

        private void txtsno_Leave(object sender, EventArgs e)
        {
            if (txtsno.Text == "")
            {
                MessageBox.Show("Please enter serial number");
                txtsno.Focus();
            }
            if (txtsno.Text.Length >= 7)
            {
                MessageBox.Show("Enter below 7 charachers ");
                txtsno.Focus();
            }

        }

        protected override void OnPaint(PaintEventArgs e)
        {
            DrawIt(e.Graphics);
        }

        private void DrawIt(Graphics G)
        {
            //PrintDocument document = new PrintDocument();
            //document.PrintPage += new PrintPageEventHandler(document_PrintPage);
            CaptureScreen();

        }
        private Bitmap _memoryImage;



        private void CaptureScreen()
        {
            // put into using construct because Graphics objects do not 
            //  get automatically disposed when leaving method scope
            using (var myGraphics = CreateGraphics())
            {
                var s = Size;
                _memoryImage = new Bitmap(1500, 1000, myGraphics);
                using (var memoryGraphics = Graphics.FromImage(_memoryImage))
                {
                    printDocument2.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("PaperA4", 826, 1169);
                    memoryGraphics.CopyFromScreen(Location.X, Location.Y, 70, 30, s);
                }
            }
        }
        private void printDocument2_PrintPage(object sender, PrintPageEventArgs e)
        {
            // calculate width and height scalings taking page margins into account
            var wScale = e.MarginBounds.Width / (float)_memoryImage.Width;
            var hScale = e.MarginBounds.Height / (float)_memoryImage.Height;

            // choose the smaller of the two scales
            var scale = wScale < hScale ? wScale : hScale;

            // apply scaling to the image
            e.Graphics.ScaleTransform(scale, scale);

            // print to default printer's page
            e.Graphics.DrawImage(_memoryImage, 70, 30);
            printDocument2.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("PaperA4", 826, 1169);
        }


        private void pd_Print(object sender, PrintPageEventArgs e)
        {
            DrawIt(e.Graphics);
        }


        private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ps.ShowDialog();
            Pd.DefaultPageSettings = Ps.PageSettings;
            Pd.PrinterSettings = Ps.PrinterSettings;
        }

        private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Pv.WindowState = FormWindowState.Maximized;
            Pv.ShowDialog();
        }

        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Pr.ShowDialog() == DialogResult.OK)
                Pd.Print();
        }

      
       

       
    }
}


While clicking on page setup i'm able to setup a page but it is showing me some other code in the page and while clicking on print preview is displaying only blank page so when i try to take print only blank page is coming...So can anyone help me from this or anyone who came across this type of error help me out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900