Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powerbi 电源BI自定义连接器日志记录未发生_Powerbi_Powerquery_Powerbi Desktop - Fatal编程技术网

Powerbi 电源BI自定义连接器日志记录未发生

Powerbi 电源BI自定义连接器日志记录未发生,powerbi,powerquery,powerbi-desktop,Powerbi,Powerquery,Powerbi Desktop,我正在Visual Studio 2017中创建一个Power BI自定义连接器,并希望在开发过程中对其进行日志记录 我在示例中遵循了这种方法,特别是在下面的TripPin示例中 诊断帮助文件diagnostics.pqm加载到my.pq文件中: Extension.LoadFunction = (name as text) => let binary = Extension.Contents(name), asText = Text.FromBin

我正在Visual Studio 2017中创建一个Power BI自定义连接器,并希望在开发过程中对其进行日志记录

我在示例中遵循了这种方法,特别是在下面的TripPin示例中

诊断帮助文件diagnostics.pqm加载到my.pq文件中:

Extension.LoadFunction = (name as text) =>
    let
        binary = Extension.Contents(name),
        asText = Text.FromBinary(binary)
    in
        Expression.Evaluate(asText, #shared);

// Diagnostics module contains multiple functions. We can take the ones we need.
Diagnostics = Extension.LoadFunction("Diagnostics.pqm");
Diagnostics.LogValue = if (EnableTraceOutput) then Diagnostics[LogValue] else (prefix, value) => value;
EnableTraceOutput设置为true,Diagnostics.pqm文件设置为“编译”“显示用户跟踪”在项目属性中为true

我引用了函数:

shared GetSomeData = (test as logical, systemfolder as text) as table =>
    let
        #"SystemFolder" = Text.Trim(Text.Clean(systemfolder)),
        #"connstring" = "Provider=myprovider;Data Source=" & AddBs(#"SystemFolder") 
            & "seqco.dbf;Collating Sequence=machine;",
        _connstring = Diagnostics.LogValue("Conn String", #"connstring"),
        #"query" = "select stuff from table",
        data = OleDb.Query(#"connstring", #"query")
in
    data;

函数被执行并返回数据,但据我所知,没有记录任何内容

典型,需要正确阅读这个该死的示例,应该像这样调用它,在OleDb中使用_connstring。Query()将强制它计算:

shared GetSomeData = (test as logical, systemfolder as text) as table =>
    let
        #"SystemFolder" = Text.Trim(Text.Clean(systemfolder)),
        #"connstring" = "Provider=myprovider;Data Source=" & AddBs(#"SystemFolder") 
            & "seqco.dbf;Collating Sequence=machine;",
        _connstring = Diagnostics.LogValue("Conn String", #"connstring"),
        #"query" = "select stuff from table",
        data = OleDb.Query(_connstring, #"query")
in
    data;