尝试创建RDLC报告但遇到异常:
textrun的值表达式'Textbox40.Paragraphs [0] .TextRuns [0]'包含一个错误:[BC30516]过载分辨率失败,因为没有可访问的< IIf'接受这个数量的论点。这是代码:
<Value>
=Fields!TermsDescription.Value & " " & Fields!PrimaryCurrency.Value & vbcrlf &
iif((Parameters!DocType.Value = "INVOICE" and Fields!ShowInterestStatement.Value), "1.5% Per Month (19.56% per Annum)" & vbcrlf & "Will be Charged on Overdue Accounts" & vbcrlf &
IIF((Parameters!DocType.Value = "ORDER ACKNOWLEDGEMENT"), "All goods sold are subject to Apex Remington's terms and conditions of sale which are available for your review at http://www.apexdistribution.com/terms", "test") &
</Value>
答案 0 :(得分:1)
您必须指定第一个IIf功能的Add-Type -AssemblyName System.Windows.Forms
Add-Type @"
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
public class pInvoke
{
[DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, ExactSpelling = true, SetLastError = true)]
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT rect);
}
"@
function Move-Window([System.IntPtr]$WindowHandle, [switch]$Top, [switch]$Bottom, [switch]$Left, [switch]$Right) {
# get the window bounds
$rect = New-Object RECT
[pInvoke]::GetWindowRect($WindowHandle, [ref]$rect)
# get which screen the app has been spawned into
$activeScreen = [System.Windows.Forms.Screen]::FromHandle($WindowHandle).Bounds
if ($Top) { # if top used, snap to top of screen
$posY = $activeScreen.Top
} elseif ($Bottom) { # if bottom used, snap to bottom of screen
$posY = $activeScreen.Bottom - ($rect.bottom - $rect.top)
} else { # if neither, snap to current position of the window
$posY = $rect.top
}
if ($Left) { # if left used, snap to left of screen
$posX = $activeScreen.Left
} elseif ($Right) { # if right used, snap to right of screen
$posX = $activeScreen.Right - ($rect.right - $rect.left)
} else { # if neither, snap to current position of the window
$posX = $rect.left
}
[pInvoke]::MoveWindow($app.MainWindowHandle, $posX, $posY, $rect.right - $rect.left, $rect.bottom - $rect.top, $true)
}
# spawn the window and return the window object
$app = Start-Process dotnet -ArgumentList "run" -PassThru
Move-Window -WindowHandle $app.MainWindowHandle -Bottom -Left
。
FalsePart