小编Bra*_*old的帖子

为什么Visual Studio报告数据屏幕不显示所有可用的数据集?

在下面的示例中,我有一些在命名空间中定义的公共类.这些将被实例化,绑定到ReportDataSets并传递给我的ReportViewer控件以从我的报表定义文件生成报表.但是,当我尝试在我的.RDLC文件的报表设计器的"报表数据"窗口中访问这些类时,它只显示了我定义的一些类.发生了什么,剩下的都在哪里?

namespace Namespace1
{
    public class Class1
    {
        public string String1 { get; set; }
    }

    public class Class2
    {
        public string String1 { get; set; }
    }
}
Run Code Online (Sandbox Code Playgroud)

注意:如果尝试将Class1定义添加到需要Class2数据的报表页面,然后在生成报表之前将Class2绑定到ReportDataSet,则会引发异常.

c# rdlc microsoft-reporting visual-studio visual-studio-2012

5
推荐指数
1
解决办法
1301
查看次数

Windows GTest EXPECT_STREQ:错误:没有用于调用'CmpHelperSTREQ'的匹配函数

出于某种原因,GTest在我的开发站上表现不佳.一些ASSERT/EXPECT测试正在运行,但我无法将字符串比较工作.这就是代码在CLion中的样子; 注意错误弹出:

在此输入图像描述

底部还附有编译时的错误输出.由于我在Windows 10上使用JetBrains CLion,GTest必须使用"MinGW Makefiles"CMake生成器,然后是MinGW make(而不是CMake默认的Visual Studio生成器).此外,我能找到的唯一工作源是最新的Github GTest主分支; 它在2016年11月的最新版本不会在MinGW的Windows上构建.

In file included from C:/PROGRA~2/GOOGLE~1/include/gtest/gtest.h:1874:0,
                 from C:\projects\gtest-test\tests\basic_test.cpp:4:
C:\projects\gtest-test\tests\basic_test.cpp: In member function 'virtual void basic_test_helloWorldEqualsHelloWorld_Test::TestBody()':
C:/PROGRA~2/GOOGLE~1/include/gtest/gtest_pred_impl.h:147:45: error: no matching function for call to 'CmpHelperSTREQ(const char [7], const char [7], std::__cxx11::string&, std::__cxx11::string&)'
   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
                                             ^
C:/PROGRA~2/GOOGLE~1/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro 'GTEST_ASSERT_'
   if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                    ^
C:/PROGRA~2/GOOGLE~1/include/gtest/gtest_pred_impl.h:162:3: note: in expansion of macro 'GTEST_PRED_FORMAT2_'
   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
   ^
C:/PROGRA~2/GOOGLE~1/include/gtest/gtest.h:1996:3: note: in expansion of macro 'EXPECT_PRED_FORMAT2' …
Run Code Online (Sandbox Code Playgroud)

c++ windows mingw googletest clion

2
推荐指数
1
解决办法
4614
查看次数

为什么节点的“fs”模块没有加载?(错误:对象#<Object>没有方法“readFile”)

由于某种原因,我的 Express 服务器无法正确加载文件系统“fs”模块。我正在使用 Angular-fullstack yeoman 生成器。我的系统是 Windows 7,节点版本为 0.10.35,npm 版本为 2.1.18,以及最新版本的 Angular-fullstack。我尝试了各种方法,例如 32 位和 64 位并更新了所有内容。

routes.js(其中有其他可以正常加载的路由):

'use strict';

var errors = require('./components/errors');
var express = require('express');
var fs = require('fs');

module.exports = function(app) {

    app.route('/pdf/*')
        .get(function(req, res) {
            var pdfPath = app.get('appPath') + '/assets/pdf/test.pdf';
            fs.readfile(pdfPath, function(error, data) {
                res.setHeader('Content-Disposition', 'attachment; filename="test.pdf"');
                res.setHeader('Content-Type', 'application/pdf');
                res.setHeader('Content-Length', data.length);
                res.status(200).end(data, 'binary');
            });
        });

    // All undefined asset or api routes should return a 404
    app.route('/:url(api|auth|components|app|bower_components|assets)/*')
        .get(errors[404]);    

    // All other routes should redirect to …
Run Code Online (Sandbox Code Playgroud)

fs node.js express angular-fullstack

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