【发布时间】:2018-10-02 23:12:28
【问题描述】:
我正在 Visual Studio 2017 中创建一个 Power BI 自定义连接器,我希望它在开发过程中记录。
我遵循了示例中的方法,特别是 diagnostics 下的 TripPin 示例。
诊断帮助文件 Diagnostics.pqm 已加载到我的 .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 文件设置为“编译”。项目属性中的“显示用户跟踪”为真。
我已经引用了函数:
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;
该函数已执行并返回数据,但据我所知,没有任何记录。
【问题讨论】:
标签: powerbi powerquery powerbi-desktop