小编ha1*_*gen的帖子

如何在不显示Excel互操作的保存对话框的情况下保存工作簿?

我必须创建一个导出DataSet到Excel 的控制台应用程序.问题是它不应该弹出保存窗口,它应该自动创建Excel文件.到目前为止,我有以下代码,但我不知道如何自动保存.非常感谢任何帮助.

public static void CreateWorkbook(DataSet ds, String path)
{
    int rowindex = 0;
    int columnindex = 0;

    Microsoft.Office.Interop.Excel.Application wapp = new Microsoft.Office.Interop.Excel.Application();
    Microsoft.Office.Interop.Excel.Worksheet wsheet;
    Microsoft.Office.Interop.Excel.Workbook wbook;

    wapp.Visible = false;

    wbook = wapp.Workbooks.Add(true);
    wsheet = (Worksheet)wbook.ActiveSheet;

    try
    {
        for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
        {
            wsheet.Cells[1, i + 1] = ds.Tables[0].Columns[i].ColumnName;

        }

        foreach (DataRow row in ds.Tables[0].Rows)
        {
            rowindex++;
            columnindex = 0;
            foreach (DataColumn col in ds.Tables[0].Columns)
            {
                columnindex++;
                wsheet.Cells[rowindex + 1, columnindex] = row[col.ColumnName]; …
Run Code Online (Sandbox Code Playgroud)

.net c# excel save office-interop

12
推荐指数
3
解决办法
6万
查看次数

如何检查ListView完成重绘的时间?

我有一个ListView.我更新了它的适配器,然后打电话notifydatasetchanged().我想等到列表完成绘制,然后调用列表上的getLastVisiblePosition()来检查最后一项.

调用getLastVisiblePosition()之后notifydatasetchanged()不起作用,因为列表处理不当画完呢.

android listview

10
推荐指数
1
解决办法
1万
查看次数

运行material-ui codemod时无法找到模块'@material-ui/core/es'错误

我正在尝试运行top-level-imports此处找到的codemod: https: //github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#top-level-imports

所以我运行了npm install -D @material-ui/codemod脚本,然后 find src -name '*.tsx' -print | xargs npx jscodeshift -t node_modules/@material-ui/codemod/lib/v4.0.0/top-level-imports.js 得到以下错误输出:

Processing 1 files... 
Spawning 1 workers...
Sending 1 files to free worker...
 ERR ./components/form/TextField.tsx Transformation error (Cannot find module '@material-ui/core/es')
Error: Cannot find module '@material-ui/core/es'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.resolve (internal/module.js:18:19)
    at transformer (.../node_modules/@material-ui/codemod/lib/v4.0.0/top-level-imports.js:29:54)
All done. 

Run Code Online (Sandbox Code Playgroud)

以前有人遇到过这种情况吗?

material-ui jscodeshift

6
推荐指数
1
解决办法
519
查看次数

如何在PgSQL中将数据库从一台服务器移动到另一台服务器?

我正在尝试将数据库从旧服务器移动到新服务器.任何帮助,将不胜感激.

database postgresql

4
推荐指数
1
解决办法
4319
查看次数

nexus 7的图像尺寸太大了?

我有一个1092 x 1596 2.23mb png我想设置为我的活动的背景.当我使用galaxy s和galaxy tab 2 10.1进行测试时,它可以正常工作,但是当我使用nexus 7测试它时,我收到一个错误:

11-30 08:37:36.961: W/OpenGLRenderer(25918): Bitmap too large to be uploaded into a texture (1454x2125, max=2048x2048)
Run Code Online (Sandbox Code Playgroud)

有人有什么建议吗?我不应该在后台使用如此大的图像吗?

android background image

4
推荐指数
1
解决办法
1532
查看次数