Results 1 to 9 of 9

Thread: Disable the print button

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Disable the print button

    Is there a way to disable the print button, and the file --> Print feature when one of my web page loads?

    Thanks
    David Wilhelm

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Disable the print button

    No.

    Other than popping a new browser window via javascript without the toolbar or menu bar.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Disable the print button

    How would I go about doing that? Currently I am using Response.Redirect("CrystalViewer.aspx"). How could I do this using java? Currently I know vb in .net fairly well but am not very proficient with java still.

    Thanks
    David Wilhelm

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Disable the print button

    Bump
    David Wilhelm

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Disable the print button

    Its not foolproof mind you... depending on security settings and the individual browser, you may still find a print option.

    Btw, its not JAVA, its javaScript... javaScript has more in common with vbScript than with Java.

    Anyway...
    Code:
    window.open('crystalviewer.aspx','report','width=400,height=400,toolbar=no,menu=no,titlebar=no,status=no');

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Disable the print button

    nemaroller, thanks for you help so far.

    I tried to create a function that I call from my code behind but it is causing an error. Here is the code.
    VB Code:
    1. <script language="javascript" type="text/javascript">
    2. function ReportOpen
    3. {window.open('crystalviewer.aspx', 'Report', 'width=400, height=400, toolbar=no, menu=no, titlebar=no status=no');}</script>

    Any ideas on what I'm doing wrong?

    Thanks
    Last edited by indydavid32; Jun 7th, 2005 at 08:20 AM.
    David Wilhelm

  7. #7
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Disable the print button

    Code:
    <script language="javascript" type="text/javascript">
    function ReportOpen()
    {
    window.open('crystalviewer.aspx', 'Report', 'width=400, height=400, toolbar=no, menu=no, titlebar=no status=no');
    }
    </script>
    You're missing the parameters enclosure after your function name
    ().

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Disable the print button

    Looks like I might have the Function created properly, now I'm having a hard time getting the button to run the function.

    Here is my revised function code.
    VB Code:
    1. <script language="javascript" type="text/javascript">
    2.     function ReportOpen()
    3.     {window.open('crystalviewer.aspx', 'P & L', 'Toolbar=no');}
    4. </script>
    This does not cause an error on the page. If it is right or not, I do not know.

    Here is my code that does not run the funtion that I created.
    VB Code:
    1. Button1.Attributes.Add("onclick", "ReportOpen(); ")
    David Wilhelm

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Disable the print button

    Yea, I figured that out right after I sent the post. I still can't get it to open the report though...
    VB Code:
    1. Button1.Attributes.Add("onclick", "ReportOpen(); ")
    David Wilhelm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width