0
私はクリスタルレポートを使ってデータベースにデータを印刷しています。ドロップダウンの値をパラメータとしてデータベースに渡したいと思います。私のコードは、入力文字列が正しい形式でないと言うエラーを出します。以下は私のコードのサンプルです。値の属性をデータベースに渡す:angularjs
これは私のhtmlコードです。
<div class="col-sm-7">
<select kendo-drop-down-list
name="PaymentCategory"
class="k-fill"
ng-init="Init()"
ng-model="ReceiptCancelWF.PaymentCategory"
k-placeholder="'Select Payment Category'"
k-data-text-field="'text'"
k-data-text-field="'Value'"
k-data-value-field="'Key'"
k-data-source="PaymentCategoryDropdown"
ng-disabled="ReceiptCancelWF.AllPayCat"></select>
</div>
これは私のフロントエンドコードです。
$scope.PaymentCategoryDropdown = [
{ "text": "Select", "value": 0 },
{ "text": "AR", "value": 1 },
{ "text": "CB", "value": 4 },
];
$scope.PrintEntry = function (form) {
var PaymentCategory = $scope.ReceiptCancelWF.PaymentCategory;
PrintService.OpenPrint('POST', appConfig.REPORT_URL + 'CPOSReportViewer.aspx', { type: "ReceiptCancellationWF", PaymentCategory: PaymentCategory},'_blank'
};
これは私のバックエンドコードです。
myReport.Load(Server.MapPath("~/CPOSReport/MIS/CancellationReports/ReceiptCancellationWorkFlow.rpt"));
myReport.SetParameterValue("@EntryType", Convert.ToInt32(Request.Form["PaymentCategory"]));
value属性を整数としてデータベースに渡したいとします。