找回密码
 立即注册

QQ登录

只需一步,快速开始

xuehf_hz

初级会员

48

主题

93

帖子

357

积分

初级会员

积分
357
xuehf_hz
初级会员   /  发表于:2019-7-25 14:03  /   查看:3759  /  回复:7
1金币
demo代码如下,粘贴到程序中,Resources.C1GridView这部分一直红色显示,提示.C1GridView不是System.Resources的成员,我用的是VB.net 开发工具是VS2017

<ul>
                    <li class="fullwidth"><input type="button" value="<%= Resources.C1GridView.ExportingExcel_Export %>" id="exportExcel"/></li>
                    <li>
                            <label><%= Resources.C1GridView.ExportingExcel_FileFormat %></label>
                            <select id="excelFileFormats">
                                    <option selected="selected" value="xls">Xls</option>
                                    <option value="xlsx">Xlsx</option>
                            </select>
                    </li>
                    <li><label><%= Resources.C1GridView.ExportingExcel_Author %></label><input type="text" id="xlsAuthor" value="ComponentOne"/></li>
                    <li><input type="checkbox" id="autoRowHeight"/><label class="widelabel"><%= Resources.C1GridView.ExportingExcel_AutoRowHeight %></label></li>
                    <li><input type="checkbox" id="showGridLines" checked="checked"/><label class="widelabel"><%= Resources.C1GridView.ExportingExcel_ShowGridLines %></label></li>
            <li class="longinput">
                                <label><%= Resources.C1GridView.ExportingExcel_ServerUrl %></label>
                                <input type="text" id="serverUrl" value="https://demos.componentone.com/ASPNET/ExportService">
                        </li>
            <li>
                                <label><%= Resources.C1GridView.ExportingExcel_FileName %></label>
                                <input type="text" id="fileName" value="export">
                        </li>
            </ul>


7 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-7-25 17:49:50
沙发
请发送完成的demo上来,我帮你验证问题
回复 使用道具 举报
xuehf_hz
初级会员   /  发表于:2019-7-25 18:55:42
板凳
我现在是可以导出了,就是导出的excel只有表头和合计,表体的行没有,一般是什么原因引起的?
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-7-25 22:28:23
地板
明天帮你验证
回复 使用道具 举报
xuehf_hz
初级会员   /  发表于:2019-7-25 22:45:04
5#
是不是这句话引起的,demo是这样写的,
$("#<%=C1GridView1.ClientID%>").c1gridview("exportGrid", fileName, type, excelSetting, url);
    }
我的C1GridView名称为vsf1 我改成
$("#<%=vsf1.ClientID%>").c1gridview("exportGrid", fileName, type, excelSetting, url);
    }这句代码会出错,后来我改成
$("#vsf1").c1gridview("exportGrid", fileName, type, excelSetting, url);
能导成功,就是没有表体,只有表头和合计
我的C1GridView代码如下
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
             <ContentTemplate>
            
                 <wijmo:C1GridView ID="vsf1" runat="server" AutogenerateColumns="False" AllowColSizing="True" AllowVirtualScrolling="False" Culture="zh-CN" DataSourceID="SqlDataSource1" FreezingMode="None" RowHeight="19"  ShowFilter="True" ScrollMode="Auto" ShowFooter="True" StaticColumnIndex="-1" StaticRowIndex="-1" ClientSelectionMode="SingleRow" style="top: 0px; left: 0px" AllowCustomPaging="True" ClientEditingUpdateMode="Manual" LoadingText="正在加载....."  OnClientCurrentCellChanging="currentCellChanging"   >


                <ScrollingSettings Mode="Auto">
                </ScrollingSettings>


                <FooterStyle BorderStyle="Solid" />
            </wijmo:C1GridView>
</ContentTemplate>
        </asp:UpdatePanel>
        
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-7-26 10:02:57
6#
你说的vsf1 应该是服务器控件的ID,所以还是需要按照demo中的写法来写,具体的建议你跟踪一下js,调试下看看你说的之前的错误原因

回复 使用道具 举报
xuehf_hz
初级会员   /  发表于:2019-7-27 11:03:34
7#
不能导出表体的原因我找出来了,如果把数据源的SelectCommand放在窗体初始化里面就能导出来,如下面代码
Private Sub BillFind_页面名称_Init(sender As Object, e As EventArgs) Handles Me.Init
SqlDataSource3.SelectCommand = "select fname from tblPro order by fname"
end sub
如果把SqlDataSource3.SelectCommand = "select fname from tblPro order by fname"放在一个查询按钮里面就不行,实际使用的情况是用户选择了各种查询条件,然后点击“查询”按钮,查询的结果绑定到C1GridView上面,如果这样的话,用demo中导出数据代码就只能导出表头和合计,实际表体里面的数据没有,请问这样该如何处理?
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-7-29 09:42:11
8#
我早上验证一下看看有没有别的方式,然后给你回复
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部