这次使用的是6.x的,无标题页&lt

2019-09-26 17:24 来源:未知

在asp.net mvc中如何利用Grid++ Report 在cshtml,razor中的管理措施

    </div>
    <table align="center" border="1" bordercolor="honeydew" cellpadding="0"
        cellspacing="0">
        <tr>
            <td style="FONT-SIZE: 9pt; COLOR: #ff0000; BACKGROUND-COLOR: #ff9933; TEXT-ALIGN: center"
                class="style1">
            </td>
            <td colspan="2"
                style="FONT-SIZE: 9pt; COLOR: #ffffff; HEIGHT: 16px; BACKGROUND-COLOR: #ff9933; TEXT-ALIGN: center">
                将Excel数据写入Access数据库中</td>
        </tr>
        <tr>
            <td style="BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: center">
            </td>
            <td style="BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: center">
                <iframe id="I1" name="I1" scrolling="yes" src="学生成绩.xls"
                    style="WIDTH: 407px; HEIGHT: 280px"></iframe>
            </td>
            <td style="WIDTH: 190px; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: center">
                <asp:GridView ID="GridView1" runat="server" CellPadding="4" Font-Size="9pt"
                    ForeColor="#333333" GridLines="None" Width="228px">
                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="BACKGROUND-COLOR: #ff9900; TEXT-ALIGN: center" class="style3">
            </td>
            <td style="HEIGHT: 23px; BACKGROUND-COLOR: #ff9900; TEXT-ALIGN: center"
                valign="top">
                <asp:Button ID="Button3" runat="server" Font-Size="9pt" onclick="Button1_Click"
                    Text="Excel数据写入Access数据库中" />
    <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"
                    style="font-size: x-small"></asp:Label>
            </td>
            <td style="WIDTH: 190px; HEIGHT: 23px; BACKGROUND-COLOR: #ff9900; TEXT-ALIGN: center">
                <asp:Button ID="Button2" runat="server" Font-Size="9pt" onclick="Button2_Click"
                    Text="数据库中彰显Excel数据" />
            </td>
        </tr>
        <tr>
            <td>
                 </td>
        </tr>
    </table>
    </form>
</body>
</html>

      
        //能够先决断 DropDownList.SelectedItem.Value
        //第二个
        sql = @"select * from webclass where parentid=" + ddl1.SelectedItem.Value;
        ddl2.DataSource = getDs(sql);
        ddl2.DataTextField = "cname";
        ddl2.DataValueField = "id";
        ddl2.DataBind();
       
        //第三个
        if (ddl2.DataSource != null) ddl2.Attributes.Add("onchange", "showNext(this.options[selectedIndex].value,'ddl3');");
        sql = @"select * from webclass where parentid=" + ddl2.SelectedItem.Value;
        ddl3.DataSource = getDs(sql);
        ddl3.DataTextField = "cname";
        ddl3.DataValueField = "id";
        ddl3.DataBind();
   
    }
}

以官方的asp.net中的第三个示范"1a.轻松表格"为例:
视图:
www.129028.com,<script src="./Scripts/CreateControl.js" type="text/javascript"></script>
<script type="text/javascript">
CreateDisplayViewerEx("100%", "100%", '@Url.Content("~/grf/1a.grf")', '@Url.Action("ViewTest_Query","Login")', true, "");
</script>
后台:

<html xmlns=";
<head id="Head1" runat="server">
    <title>无标题页</title>
    <style type="text/css">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

奥莱dbReportData.DoGenDetailData2自己本人写的不二诀要,就是回去二个dataset
public static DataSet DoGenDetailData2(string QuerySQL)
{
OleDbConnection ReportConn = new OleDbConnection(OleDbConnStr);
OleDbDataAdapter ReportDataAdapter = new OleDbDataAdapter(QuerySQL, ReportConn);
DataSet ReportDataSet = new DataSet();
ReportConn.Open();
ReportDataAdapter.Fill(ReportDataSet);
ReportConn.Close();
return ReportDataSet;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";

using System;
using System.Data;
using System.Configuration;
using System.Data.OleDb;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

仰望能帮到你.

    <div>

default.aspx内容:

public ActionResult ViewTest_Query()
{
return Content(OledbReportData.DoGenDetailData2("select * from Customers order by CustomerID").GetXml;
}

    }
    public OleDbConnection CreateCon()
    {
        string strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data source="

    }
    /**//// <summary>
    /// //数据绑定
    /// </summary>
    private void BindDc()
    {
        //第一个
        string sql = @"select * from webclass where Parentid=0";
        ddl1.DataSource = getDs(sql);
        ddl1.DataTextField = "cname";
        ddl1.DataValueField = "id";
        ddl1.DataBind();
        if (ddl1.DataSource != null) ddl1.Attributes.Add("onchange", "showNext(this.options[selectedIndex].value,'ddl2');");

文件用到的类都在合法示例中.

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

<html xmlns="" >
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>AjaxPro完成无刷新三级联合浮动</title>
</head>
<script language="javascript" type="text/javascript">
      <!--
       // ACLOUD 常用JS函数
       function getBid(s){
          return document.getElementById(s);
        }
        function getBmc(s){
          return document.getElementByName(s);
        }
       
       //展现分类列表
       function showNext(sid,obj)
        {
          if(sid==null || sid=="" || sid.length<1)return;
          var slt =getBid(obj);
          var v = _Default.getNextClass(sid).value; // 类的名号
          //alert(v);
          //return;
          if (v != null){     
          if(v != null && typeof(v) == "object" && v.Tables != null)
                    {       
                        slt.length = 0;
                        slt.options.add(new Option("请选择",0));
                        //加了个“请选取”首要为了触发onchange事件
                        if(obj=="ddl2"){
                        getBid("ddl3").options.length=0;
                        getBid("ddl3").options.add(new Option("请选择",0));
                        }           
                        for(var i=0; i<v.Tables[0].Rows.length; i++)
                    {
                        var txt = v.Tables[0].Rows[i].txt; //这些地方供给小心区分轻重缓急写
                      var vol = v.Tables[0].Rows[i].vol; //跟dataset表的列名称要一致
                      slt.options.add(new Option(txt,vol));
                    }
                    }
           }   
           return;
        }
        -->
</script>
<body>
    <form id="form1" runat="server">
    <div>
      <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="99"> </td>
          <td width="401">
              城市<asp:DropDownList ID="ddl1" runat="server">
              </asp:DropDownList>
              区域<asp:DropDownList ID="ddl2" runat="server">
              </asp:DropDownList>
              花园<asp:DropDownList ID="ddl3" runat="server">
              </asp:DropDownList></td>
        </tr>
        <tr>
          <td> </td>
          <td> </td>
        </tr>
        <tr>
          <td> </td>
          <td> </td>
        </tr>
      </table>
   
    </div>
    </form>
</body>
</html>
连带文书

代码文件于二零零七-5-13更新过 列出了取值的点子

TAG标签:
版权声明:本文由www.129028.com-澳门金沙唯一官网www129028com发布于编程新闻,转载请注明出处:这次使用的是6.x的,无标题页&lt