الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تغيير لون زر الbutton عند مرور المؤشر عليه+طباعة grid view

بدأه rauf911 في 15 يونيو 2010 · 28 رد · 6,165 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

شاهدت في عدة مواقع هذه الخاصيه

وهي أني عندما امرر مؤشر الفاره فوق زر الbutton يتغير لون الزر وعندما يبتعد المؤشر عنه يعود الزر للونه الطبيعي

فكيف بإمكاني عمل هذا الأمر?

الاستفسار الثاني

وهو كيف أقوم بطباعة محتوى الgrid view ؟

أرجو منكم مساعدتي وجزاكم الله خير

#2

هذا الرابط لطباعة ال gridview

/index.php?showtopic=223289

اما لتغيير اللون توجد طريقتين

1- cSS

2-javascript

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
#cell:hover
{
background-color: #000000;
color: #ffffff;
}



.cell:hover
{
background-color: #5f5955;
color: #999999;
}


</style>
</head>

<body>
هذه الطريقة على ال css 
تعتمدعلى ال id
<button style="width: 120px" id="cell">test</button><br />
هذه تعتمد على ال class
<button style="width: 120px" class="cell">test</button>
<br />
هذه الطريقة على الجافا سكريبت
<button style="width: 120px" onmouseover="document.getElementById('test').style.background='#00aaff';document.getElementById('test').style.color='#ff0099';" onmouseout="document.getElementById('test').style.background='#ffffff';document.getElementById('test').style.color='#000000';" id="test">test</button>
</body>

</html>

Untitled_1.rar

In bad state

#3

بسم الله الرحمن الرحيم

اخى العزيز

<style id="Style1" type="text/css" runat="server">
.cs
{
background-color:Window;
}
.cs1
{
background-color:ButtonFace;
}
</style>
<script type="text/javascript">
function mov()
{
var btnid= document.getElementById('btn1');
btnid.className='cs';
}
function mout()
{ 
var btnid= document.getElementById('btn1');
btnid.className='cs1';
}


</script>

<input type="button" id="btn1" value="Change" onmouseover="mov()" onmouseout="mout()" runat="server"  onclick="return btn1_onclick()" />

اتمنى اكون افدتك

#4
bodaman22 كتب:

بسم الله الرحمن الرحيم

اخى العزيز

<style id="Style1" type="text/css" runat="server">
.cs
{
background-color:Window;
}
.cs1
{
background-color:ButtonFace;
}
</style>
<script type="text/javascript">
function mov()
{
var btnid= document.getElementById('btn1');
btnid.className='cs';
}
function mout()
{ 
var btnid= document.getElementById('btn1');
btnid.className='cs1';
}


</script>

<input type="button" id="btn1" value="Change" onmouseover="mov()" onmouseout="mout()" runat="server"  onclick="return btn1_onclick()" />

اتمنى اكون افدتك

حلو طريقة تالتة الدمج بين الclass and javascript

:)

In bad state

#5

طيب يا اخواني انا استخدم أي طريقة ؟

وكيف استخدم cSS ؟

هل لا بد من استخدام كود html يعني ما بينفع نستخدم كود vb ؟

وهل الكود اللي كتبتوه عام للصفحة اللي فيها ال button ولا لكل الصفحة؟

يعني كيف طريقة كتابته اذا افترضنا انه هدا هو كود ال button

<td class="style38">

<asp:Button ID="Button6" runat="server" Height="30px" Text="صفحة المدير"

Width="170px" Font-Bold="True" BackColor="#DBDBDB"

BorderColor="#CC9900"

style="text-align: center" />

</td>

تم تعديل هذه المشاركة بواسطة rauf911 في 16 يونيو 2010 في 09:39

#6

اخي الكريم بينفع جدا وفي خاصية لادوات الاي اس بي

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">



.cell:hover 
{ 
background-color: #5f5955; 
color: #999999; 
} 



    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:HyperLink ID="HyperLink1" runat="server" CssClass="cell">HyperLink</asp:HyperLink>

    </div>
    </form>
</body>
</html>

خي الكريم ابحث عن class and ID

ID: يمكن ربطه مع عنصر وحيد له نفس ال id

class: يمكن ربطه مع اكثر من عنصر

لكتابة id

عليك بكتابة # قبل اسم ال id

اما لكتابة class

عليك بوضع نقطة بالبداية

انظر المثال اعلاه

بالتوفيق

In bad state

#7

جزاكم الله خير يا اخواني الكرام

بس للأسف ما فهمت شرحكم المشكلة للأسف انها مني لقلة خبرتي وقلة استيعابي لشرحكم

اتمنى اني افهم اللي شرحتوه رح احاول ان شاء الله

المشكلة عندي مش عارف الاكواد اللي انتو كتبتوها اكتبها فين ولا عارف معناها ايه

حتى انا نسخت ليكم مثال للزر الوحيد اللي عايز اعمله هده الخاصيه عشان اقدر اطبق المثل عليه

بس للأسف ما وصلتني فكرتم جزاكم الله خير

#9

يا حبيبي يا اخي الكريم انا عندي ازرار من اول انشأتها وخالصه

انا برنامجي شبه جاهز

بس باقيلو لمسات جماليه

يعني مش محتاج انشئ ازرار button من جديد بس اللي عايزه اغيره في خصائص ال button فقط

<table class="style36">
                        <tr>
                            <td class="style38">
        <asp:Button ID="Button6" runat="server" Height="30px" Text="صفحة المدير" 
            Width="170px" Font-Bold="True" BackColor="#DBDBDB" 
            BorderColor="#CC9900" 
        style="text-align: center" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style37">
    <asp:Button ID="Button3" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="المشاكل المحلولة" Width="170px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style39">
    <asp:Button ID="Button4" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="البحث عن مشاكل الموظفين" 
            Width="170px" />
                            </td>
                        </tr>
                        <tr>
                            <td>
    <asp:Button ID="Button5" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="ملخص عن مشاكل الموظفين" Width="170px" />
                            </td>
                        </tr>
                        <tr>
                            <td>
        <asp:Button ID="Button2" runat="server" Height="30px" Text="تسجيل الخروج" 
            Width="170px" Font-Bold="True" BackColor="#DBDBDB" 
            BorderColor="#CC9900" 
        style="text-align: center" />
                            </td>
                        </tr>
                    </table>

اللي عايز اعرفه

ايش الحاجات اللي اغيرها في خصائص ال button عندي

#10
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">


    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table>
                        <tr>
                            <td class="style38">
        <asp:Button ID="Button6" runat="server" Height="30px" Text="صفحة المدير" 
            Width="170px" Font-Bold="True" BackColor="#DBDBDB" 
            BorderColor="#CC9900" 
        style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#005599';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="style37">
    <asp:Button ID="Button3" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="المشاكل المحلولة" Width="170px"  onmouseover="document.getElementById(this.id).style.backgroundColor='#005599';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="style39">
    <asp:Button ID="Button4" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="البحث عن مشاكل الموظفين" 
            Width="170px" onmouseover="document.getElementById(this.id).style.backgroundColor='#005599';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'" />
                            </td>
                        </tr>
                        <tr>
                            <td>
    <asp:Button ID="Button5" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="ملخص عن مشاكل الموظفين" Width="170px"  onmouseover="document.getElementById(this.id).style.backgroundColor='#005599';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
        <asp:Button ID="Button2" runat="server" Height="30px" Text="تسجيل الخروج" 
            Width="170px" Font-Bold="True" BackColor="#DBDBDB" 
            BorderColor="#CC9900" 
        style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#005599';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                    </table>
    </div>
    </form>
</body>
</html>

In bad state

#11

شكراً أخي الكريم بارك الله فيك

الحمدلله زبطت الفكره

وجزاكم الله 1000 خير على مجهوداتكم الطيبه

يعطيكم العافيه يا شباب

طيب يا شباب بالنسبة لطباعة الجريد فيو بصراحة انا دخلت الرابط

وشفت الموجود فيه وشفت الاكواد بس ما بعرف وين بتنكتب في الform ولا div ولا.....

يعني ملخبط يعني انا عن نفسي عندي الجريد فيو جاهز وفيه بداخله داتا بس بدي اعرف كيف لو عايز اطبعه وهدا هو الكود تبعي

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BackColor="#DBDBDB" BorderColor="#282B28" BorderStyle="Outset" 
            BorderWidth="3px" CellPadding="4" DataKeyNames="problem_ID" 
            DataSourceID="AccessDataSource1" Font-Bold="True" 
            ForeColor="Black" GridLines="Vertical" Width="1035px" HorizontalAlign="Center" 
                        style="margin-top: 0px; margin-left: 0px;" AllowSorting="True" 
                        Font-Size="Small">
            <FooterStyle BackColor="#CCCC99" />
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:BoundField DataField="prob_states" HeaderText="prob_states" 
                    SortExpression="prob_states" Visible="False" >
                </asp:BoundField>
                <asp:BoundField DataField="emp_no" HeaderText="emp_no" 
                    SortExpression="emp_no" Visible="False" />
                <asp:BoundField DataField="emp_Email" HeaderText="ايميل الموظف" 
                    SortExpression="emp_Email" />
                <asp:BoundField DataField="CountOfemp_no" HeaderText="عدد الردود" 
                    SortExpression="CountOfemp_no" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_date" HeaderText="تاريخ المشكلة" 
                    SortExpression="prob_date" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_level" HeaderText="مستوى المشكلة" 
                    SortExpression="prob_level" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_descrp" HeaderText="وصف المشكلة" 
                    SortExpression="prob_descrp" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_type" HeaderText="نوع المشكلة" 
                    SortExpression="prob_type" >
                </asp:BoundField>
                <asp:BoundField DataField="problem_ID" HeaderText="رقم المشكلة" 
                    InsertVisible="False" SortExpression="problem_ID">
                </asp:BoundField>
                <asp:BoundField DataField="emp_name" HeaderText="اسم الموظف" 
                    SortExpression="emp_name">
                </asp:BoundField>
                <asp:CommandField ShowSelectButton="True" SelectText="اختيار" />
            </Columns>
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" 
                HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="Silver" ForeColor="White" Font-Bold="True" />
            <HeaderStyle BackColor="#9B9B9B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>

فأرجو اني اعرف ايش اضيف عليه عشان اقدر اطبعه

وجزاكم الله خير

تم تعديل هذه المشاركة بواسطة rauf911 في 17 يونيو 2010 في 10:38

#12
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Untitled Page</title> 
    <script language="javascript"> 
    var newwindwo; 
    function printgridview() 
    { 
    newwindwo=window.open("","gridview","height=500,width=400");//انشاء نافذة جديدة 
    var str=document.getElementById("<%=GridView1.ClientID%>").innerHTML;//أخذ القيم الموجودة ضمن الكريد فيو 
    newwindwo.document.writeln("<table>"+str+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")//اضافة الكريد فيو الى النافذة الجديدة 
//  ولكن هنا كانت مشكلة وهي ان عملية اخذ محتوى الكريد فيو تتم بدون اخذ وسمي البداية والنهاية للجدول لذلك اضفت الوسوم يدوي  
    newwindwo.print(); // الطباعة    
    } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  
            BackColor="#DBDBDB" BorderColor="#282B28" BorderStyle="Outset"  
            BorderWidth="3px" CellPadding="4" DataKeyNames="problem_ID"  
            DataSourceID="AccessDataSource1" Font-Bold="True"  
            ForeColor="Black" GridLines="Vertical" Width="1035px" HorizontalAlign="Center"  
                        style="margin-top: 0px; margin-left: 0px;" AllowSorting="True"  
                        Font-Size="Small"> 
            <FooterStyle BackColor="#CCCC99" /> 
            <RowStyle BackColor="#F7F7DE" /> 
            <Columns> 
                <asp:BoundField DataField="prob_states" HeaderText="prob_states"  
                    SortExpression="prob_states" Visible="False" > 
                </asp:BoundField> 
                <asp:BoundField DataField="emp_no" HeaderText="emp_no"  
                    SortExpression="emp_no" Visible="False" /> 
                <asp:BoundField DataField="emp_Email" HeaderText="ايميل الموظف"  
                    SortExpression="emp_Email" /> 
                <asp:BoundField DataField="CountOfemp_no" HeaderText="عدد الردود"  
                    SortExpression="CountOfemp_no" > 
                </asp:BoundField> 
                <asp:BoundField DataField="prob_date" HeaderText="تاريخ المشكلة"  
                    SortExpression="prob_date" > 
                </asp:BoundField> 
                <asp:BoundField DataField="prob_level" HeaderText="مستوى المشكلة"  
                    SortExpression="prob_level" > 
                </asp:BoundField> 
                <asp:BoundField DataField="prob_descrp" HeaderText="وصف المشكلة"  
                    SortExpression="prob_descrp" > 
                </asp:BoundField> 
                <asp:BoundField DataField="prob_type" HeaderText="نوع المشكلة"  
                    SortExpression="prob_type" > 
                </asp:BoundField> 
                <asp:BoundField DataField="problem_ID" HeaderText="رقم المشكلة"  
                    InsertVisible="False" SortExpression="problem_ID"> 
                </asp:BoundField> 
                <asp:BoundField DataField="emp_name" HeaderText="اسم الموظف"  
                    SortExpression="emp_name"> 
                </asp:BoundField> 
                <asp:CommandField ShowSelectButton="True" SelectText="اختيار" /> 
            </Columns> 
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black"  
                HorizontalAlign="Right" /> 
            <SelectedRowStyle BackColor="Silver" ForeColor="White" Font-Bold="True" /> 
            <HeaderStyle BackColor="#9B9B9B" Font-Bold="True" ForeColor="White" /> 
            <AlternatingRowStyle BackColor="White" /> 
        </asp:GridView>

    <a href="javascript:printgridview();">print</a> 
    </div> 
    </form> 
</body> 
</html>

اخي الكريم فقط استبدل ال grid view بال gridview الموجود بصفحتك

دقق جيدا

بالتوفيق

In bad state

#13

أخي x-file أشكر لك مجهوداتك ومتابعتك لي

اخي الكريم ان الصفحة التي يوجد بها الجريد فيو يوجد بها تداخلات عديدة

حيث اني قمت بالتعديل على الكود حسب التعديلات والاكواد التي ارسلتها لي

ولكن لما اقوم اعدل بمكان بتخرب بمكان تاني.....وهدا راجع لقلة خبرتي بالـhtml

فقلت خليني انسخلك كود الصفحة بالكامل وشف التداخلات هاي كيف ممكن تنحل والكود انا ارفقتلك اياه ارجوك اطلع عليه وحاول تساعدني فيه الله يسعدك

عارك اني كتير غلبه وغلبتك بس كل اللي بقولو جزاك الله خير والله يعطيك العافية

html code.rar

#14
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="admin.aspx.vb" Inherits="admin" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>صفحة المدير</title>
        <script language="javascript">  
    var newwindwo;  
    function printgridview()  
    {  
    newwindwo=window.open("","gridview","height=500,width=400");
    var str=document.getElementById("<%=GridView1.ClientID%>").innerHTML;
        newwindwo.document.writeln("<table>"+str+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")
    newwindwo.print();      
    }  
    </script>


    <style type="text/css">
        #form1
        {
            width: 1240px;
            text-align: right;
            height: 523px;
        }
        .style32
        {
            width: 100%;
            height: 525px;
        }
        .style33
        {
            width: 1029px;
            border-left-style: solid;
            border-left-width: 1px;
            border-right-style: solid;
            border-right-width: 1px;
            border-top-style: solid;
            border-top-width: 3px;
            border-bottom-style: solid;
            border-bottom-width: 1px;
            padding: 1px 4px;
            height: 381px;
        }
        .style34
        {
            width: 1029px;
            height: 100px;
            text-align: center;
            font-weight: 700;
            font-size: xx-large;
            font-family: "Arial Black";
        }
        .style35
        {
            height: 124px;
        }
        .style36
        {
            width: 100%;
            height: 180px;
        }
        .style37
        {
            height: 32px;
        }
        .style38
        {
            height: 34px;
        }
        .style39
        {
            height: 19px;
        }
        .style40
        {
            height: 381px;
        }
        .style41
        {
            list-style-type: square;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server" >

        <table class="style32">
            <tr>
                <td class="style34" 

                    style="border-right-style: outset; border-bottom-style: outset; border-width: 4px; border-color: #DBDBDB; font-size: 4pc; background-image: url('2.jpg'); color: #FFFFFF;">
            <asp:Label ID="Label1" runat="server" Text="Label" Font-Size="4pc"></asp:Label>
                     مـرحـبــاً</td>
                <td class="style35" 

                    style="border-style: outset; border-width: 4px; border-color: #DBDBDB" 
                    align="center">
                    <asp:Image ID="Image1" runat="server" Height="89px" 
                        ImageUrl="~/ID Card copy jpg.JPG" style="margin-left: 0px" Width="179px" />
                </td>
            </tr>
            <tr>
                <td class="style33" 

                    style="border-style: outset outset none none; border-width: 5px; border-color: #DBDBDB" 
                    align="center" valign="top">
        <asp:Label ID="Label2" runat="server" BorderColor="#DBDBDB" 
            BorderStyle="None" BorderWidth="3px" Font-Bold="True" Font-Size="Large" 
            Height="26px" Text="قم باختيار أحد من المشاكل التالية لعرض التفاصيل" 
            Width="1008px" style="text-align: center"></asp:Label>

                    <br />

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BackColor="#DBDBDB" BorderColor="#282B28" BorderStyle="Outset" 
            BorderWidth="3px" CellPadding="4" DataKeyNames="problem_ID" 
            DataSourceID="AccessDataSource1" Font-Bold="True" 
            ForeColor="Black" GridLines="Vertical" Width="1035px" HorizontalAlign="Center" 
                        style="margin-top: 0px; margin-left: 0px;" AllowSorting="True" 
                        Font-Size="Small">
            <FooterStyle BackColor="#CCCC99" />
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:BoundField DataField="prob_states" HeaderText="prob_states" 
                    SortExpression="prob_states" Visible="False" >
                </asp:BoundField>
                <asp:BoundField DataField="emp_no" HeaderText="emp_no" 
                    SortExpression="emp_no" Visible="False" />
                <asp:BoundField DataField="emp_Email" HeaderText="ايميل الموظف" 
                    SortExpression="emp_Email" />
                <asp:BoundField DataField="CountOfemp_no" HeaderText="عدد الردود" 
                    SortExpression="CountOfemp_no" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_date" HeaderText="تاريخ المشكلة" 
                    SortExpression="prob_date" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_level" HeaderText="مستوى المشكلة" 
                    SortExpression="prob_level" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_descrp" HeaderText="وصف المشكلة" 
                    SortExpression="prob_descrp" >
                </asp:BoundField>
                <asp:BoundField DataField="prob_type" HeaderText="نوع المشكلة" 
                    SortExpression="prob_type" >
                </asp:BoundField>
                <asp:BoundField DataField="problem_ID" HeaderText="رقم المشكلة" 
                    InsertVisible="False" SortExpression="problem_ID">
                </asp:BoundField>
                <asp:BoundField DataField="emp_name" HeaderText="اسم الموظف" 
                    SortExpression="emp_name">
                </asp:BoundField>
                <asp:CommandField ShowSelectButton="True" SelectText="اختيار" />
            </Columns>
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" 
                HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="Silver" ForeColor="White" Font-Bold="True" />
            <HeaderStyle BackColor="#9B9B9B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
                    <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/db1.mdb" 
            SelectCommand="SELECT * FROM [ProbcountWithEmail] WHERE ([prob_states] = ?)">
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Name="prob_states" Type="Int32" />
            </SelectParameters>
        </asp:AccessDataSource>
        <a href="javascript:printgridview();" >Print</a>
                    <ul class="style41" dir="rtl">
                        <li>
                            <p style="text-align: right; font-size: large; color: #CC9900;">
                                <asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True" 
                                    Font-Italic="False" Font-Overline="False" Font-Size="Large" 
                                    Font-Strikeout="False" Font-Underline="True">تـــابـــــع 
                                الـــمـــشـــكــــلـــة</asp:LinkButton>
                            </p>
                        </li>
                    </ul>
                </td>
                <td style="border-style: outset outset none outset; border-width: 5px; border-color: #DBDBDB" 
                    valign="top" class="style40" align="center">
                    <table class="style36">
                        <tr>
                            <td class="style38">
        <asp:Button ID="Button6" runat="server" Height="30px" Text="صفحة المدير"  
            Width="170px" Font-Bold="True" BackColor="#CC9900"  
            BorderColor="#CC9900"  
        style="text-align: center" BorderStyle="Inset"/> 
                            </td>
                        </tr>
                        <tr>
                            <td class="style37">
    <asp:Button ID="Button3" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="المشاكل المحلولة" Width="170px" 
         style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#CC9900';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="style39">
    <asp:Button ID="Button4" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="البحث عن مشاكل الموظفين" 
            Width="170px"  style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#CC9900';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
    <asp:Button ID="Button5" runat="server" BackColor="#DBDBDB" 
        BorderColor="#CC9900" Font-Bold="True" Height="30px" Text="ملخص عن مشاكل الموظفين" Width="170px" 
         style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#CC9900';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
        <asp:Button ID="Button2" runat="server" Height="30px" Text="تسجيل الخروج" 
            Width="170px" Font-Bold="True" BackColor="#DBDBDB" 
            BorderColor="#CC9900" 
        style="text-align: center"  onmouseover="document.getElementById(this.id).style.backgroundColor='#CC9900';" onmouseout="document.getElementById(this.id).style.backgroundColor='#DBDBDB'"/>
                            </td>
                        </tr>
                    </table>

                    </td>
            </tr>
        </table>

    </form>
</body>
</html>

ان ظهرت مشاكل اعلمني

ولا يهمك

بالتوفيق

In bad state

#15

جزاك الله خير اخي الكريم

الحمدلله رب العالمين اشتغلت الطباعه واخر حلاوة

الله يسلملي ايديك يارب

ويعطيك الف عافيه

بس لو قدرت وقت ما تشوف ردي تديني طريقة كيف اغير شكل الطباعة عشان لما اجيت اطبع طلعت الورقة اسود وابيض و مو مخطط الجدول يعني طلع متغير عن شكل الـformat اللي انا عملته

وتقولي ازا بينفع استخدم هاي الطريقة اذا كان عندي 2 جريد في نفس الصفحة عشان انا حاولت وما قدرت

الله يسعدك لو بتعرفلها حل اديني اياه وجزاك الله خير

تم تعديل هذه المشاركة بواسطة rauf911 في 19 يونيو 2010 في 09:02

#16

عدل بخاصية بالبوردر بالسي اس اس

newwindwo.document.writeln("<table border="1">"+str+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")

In bad state

#17

اوك حبيبي جزاك الله خير تم تسطير الجدول بشكل جميل ولكن ماذا كنت تقصد في عدل في خاصية البوردر بcss

كيف استطيع ان اقوم بالدخول لخصائص الجدول داخل صفحة الطباعة

انا اللي بعرفه انه ممكن اغير في البوردر الموجود في الصفحة الاصلية للجريد فيو ولكن صفحة الطباعة كيف من الممكن ادخل الى خصائصها لتعديلها

خاصة واني اريد ان اعمل الكثير من التغييرات على شكل الجدول عند طباعتة مثل المحاذاة عندي جايه على اليسار الجدول والكتابة اللي بداخله

فإذا كان في طريقة اني اغير الخصائص تبعت الجدول في صفحة الطباعة ارجوك خبرني بلكي تزبط معي

وغير هيك يا اخي الكريم هل ممكن انا نطبع 2 جريد فيو في صفحة وحدة يعني مثلا هنالك جدول يوجد به تفاصيل مشكلة معينه

ولدي في نفس الصفحة تعليقات من المسؤولين عن حل المشاكل في جريد فيو اخر في نفس الصفحة

هل من الممكن طباعة الاثنين في صفحة واحدة؟

وشكراً

تم تعديل هذه المشاركة بواسطة rauf911 في 19 يونيو 2010 في 13:57

#18

اخي الكريم بالسي اس اس يمكنك التحكم بكامل اعدادات الجدول

newwindwo.document.writeln("<table style='border-left-color: aqua;border-left-style: dashed;'>"+str+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")

دقق فيما بعد كلمة style

اما عن ال gridview

يمكنك طباعة اكثر من واحد

فقط استخدم

 var str2=document.getElementById("<%=GridView2.ClientID%>").innerHTML; 
var str3= str+"<br />"+str2;
        newwindwo.document.writeln("<table>"+st3+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")

اي فقط اضفه تحت

str

بكل الاحوال ان ما زالت الفكرة غامضة اخبرني

In bad state

#19

جزاك الله خير أخي الفاضل x-file

بجد مو عارف شو احكيلك وكيف اشكرك

الله يسعدك ويوفقك ويجزيك بالخير

الحمدلله كل اللي اللي طلبته تم حله والحمدلله جزاك الله خير

#20

الحمد لله رب العالمين

مافي حاجة للشكر نحنا اخوة :)

بالتوفيق والى الاما م ..

In bad state

#21

أخي xfile ممكن استفسار بسيط

ليش لما اجيت اطبع ال2 grid view اللي عندي بالصفحة

أجوني ما في بينهم مسافه يعني متصلين في بعض

وبالمره مو راضي الجدول يتلون بيجي ابيض

بينفع اغير لونه اللي هو header style حاولت ما نفع

#22

أرجو أن يقوم أحد الاخوة بمساعدتي

#23

أرجو من أ] أحد من الاخوان يستطيع مساعدتي ان يقوم بذلك لحاجتي الشديدة لانهاء هذا الموضوع

#24
var str2=document.getElementById("<%=GridView2.ClientID%>").innerHTML;  
str2="<table>"+str2+"</table><br />"
var str3= str+"<br />"+str2; 
newwindwo.document.writeln("<table>"+st3+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'>Close</a>")

المشكلة بكودي الخطا ما كنت منتبه يجب فصل الجدولين

هكذا تم فصلهما

لكل جدول

table بداية ونهاية اما عن تغيير البوردر كلها من css

style="border"

طبعا هذا ليس كود ولكن لتبيان ان يتم وضع خصائص البوردر

طريقة لتستطيع وضعها

انزل الى اي جدول او ديف واعمل خصائص البوردر له ومن ثم قصها وضعها بعد

style='cursor:pointer;border:هنا'

In bad state

#25

أخي الكريم X-file بارك الله فيك

أي نعم لقد تم فصل الجدولين عن بعض أي انه من الممكن ان تميز بين الجدولين

ولكن لا توجود مسافة بينهما إطلاقا

<script language="javascript">

var newwindwo;

function printgridview()

{

newwindwo=window.open("","gridview","resizable=yes,toolbar=yes,width=600,height=600,scrollbars=yes");

var str=document.getElementById("<%=GridView1.ClientID%>").innerHTML;

var str2=document.getElementById("<%=GridView2.ClientID%>").innerHTML;

str2="<table>"+str2+"</table><br />"

var str3= str+"<br />"+str2;

newwindwo.document.writeln("<center><table border=1 style='text-align:right'>"+str3+"</table>"+"<br />"+"<a onclick='self.close()' style='cursor:pointer'></a>")

newwindwo.print();

}

</script>

هل هناك خطأ فيما اكتبه ربما؟؟؟

جزاك الله خير

تم تعديل هذه المشاركة بواسطة rauf911 في 26 يونيو 2010 في 15:24

مواضيع مشابهة