Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.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
Visual studio 尚未指定某些参数或凭据(RDLC)_Visual Studio_Reporting Services_Rdlc_Reportviewer - Fatal编程技术网

Visual studio 尚未指定某些参数或凭据(RDLC)

Visual studio 尚未指定某些参数或凭据(RDLC),visual-studio,reporting-services,rdlc,reportviewer,Visual Studio,Reporting Services,Rdlc,Reportviewer,我在网上查过了,但似乎没有什么能让我在没有这个问题的情况下显示我的报告。我的报表只有1个子报表和3个参数。我也检查了拼写。如果我注释掉子报表部分,那么我可以看到子报表部分附近有错误的报表(这很有意义,因为它希望我添加数据。下面是代码。知道我缺少什么吗 私有void Form2_加载(对象发送方、事件参数e) { DataSet ds1 = DataAdapterSelectQuery("SELECT DISTINCTROW tblInvoice.*, tblInvoiceDeta

我在网上查过了,但似乎没有什么能让我在没有这个问题的情况下显示我的报告。我的报表只有1个子报表和3个参数。我也检查了拼写。如果我注释掉子报表部分,那么我可以看到子报表部分附近有错误的报表(这很有意义,因为它希望我添加数据。下面是代码。知道我缺少什么吗

私有void Form2_加载(对象发送方、事件参数e) {

        DataSet ds1 = DataAdapterSelectQuery("SELECT DISTINCTROW tblInvoice.*, tblInvoiceDetail.intNo, tblInvoiceDetail.memDescription, tblInvoiceDetail.dblQuantity, tblInvoiceDetail.strUnit, tblInvoiceDetail.curAmount, [dblQuantity] *[curAmount] -[curDiscount] +[curTax] AS curTotal, ([strFirstName] + ' ') & [strSirName] AS strCustomer, tblInvoice.memQRCode, [memDescription] + ('(' & [strtaxcodes] & ')') AS DetailWithTaxCodes, IIf([tblInvoice]![strVMSInvType] = 'Normal', ' ============ FISCAL INVOICE ============ ', ' ===== THIS IS NOT A FISCAL RECEIPT ===== ') AS strTop, IIf([tblInvoice]![strVMSInvType]='Normal',' ======== END OF FISCAL INVOICE ========= ',' ===== THIS IS NOT A FISCAL RECEIPT ===== ') AS strBottom, tblInvoiceDetail.curDiscount, [curTotal]/[dblQuantity] AS curUnitAfterTax FROM(tblCustomers INNER JOIN tblInvoice ON tblCustomers.strCustCode = tblInvoice.strCustCode) INNER JOIN tblInvoiceDetail ON(tblInvoice.intInvType = tblInvoiceDetail.intInvType) AND(tblInvoice.lngInvNo = tblInvoiceDetail.lngInvNo) AND(tblInvoice.strVMSInvType = tblInvoiceDetail.strVMSInvType);");
        DataTable dt1 = ds1.Tables[0];
        dt1.TableName = "DataSet1";
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt1));

        DataSet ds2 = DataAdapterSelectQuery("SELECT strName, memAddress, s_GUID, oleLogo, strTaxNo FROM tblSystem");
        DataTable dt2 = ds2.Tables[0];
        dt2.TableName = "DataSet2";
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dt2));

        DataSet ds3 = DataAdapterSelectQuery("SELECT strName, memAddress, s_GUID, oleLogo, strTaxNo FROM tblSystem");
        DataTable dt3 = ds3.Tables[0];
        dt3.TableName = "DataSet3";
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet3", dt3));

        this.reportViewer1.RefreshReport();

        reportViewer1.LocalReport.SubreportProcessing +=
              new SubreportProcessingEventHandler(InvoiceVMSSubTaxSubreportProcessingEventHandler);

        this.reportViewer1.RefreshReport();
        reportViewer1.LocalReport.Refresh();
    }

    private DataTable GetInvoiceVMSSubTaxSubReport(int lngInvNo, int intInvType, string strVMSInvType)
    {
        DataSet dsSubReport = DataAdapterSelectQuery("SELECT tblInvoiceTax.strVMSInvType, tblInvoiceTax.lngInvNo, tblInvoiceTax.intInvType, tblInvoiceTax.strLabel, tblInvoiceTax.strName, Format(tblInvoiceTax.[dblRate], 'Fixed') & [strSuffix] AS strRate, tblInvoiceTax.curTax FROM tblTaxCodes INNER JOIN tblInvoiceTax ON tblTaxCodes.strTaxLabel = tblInvoiceTax.strLabel WHERE lngInvNo = " + lngInvNo + " AND intInvType = " + intInvType + " AND strVMSInvType = '" + strVMSInvType + "'; ");
        DataTable dtSubreport = dsSubReport.Tables[0];
        dtSubreport.TableName = "DataSet1";
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtSubreport));
        return dtSubreport;
    }

    void InvoiceVMSSubTaxSubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
    {
        int lngInvNoParameter = int.Parse(e.Parameters["lngInvNoParameter"].Values[0].ToString());
        int intInvTypeParameter = int.Parse(e.Parameters["intInvTypeParameter"].Values[0].ToString());
        string strVMSInvTypeParameter = e.Parameters["strVMSInvTypeParameter"].Values[0].ToString();

        DataTable dtInvoiceVMSSubTaxSubReport = GetInvoiceVMSSubTaxSubReport(lngInvNoParameter, intInvTypeParameter, strVMSInvTypeParameter);

        ReportDataSource ds = new ReportDataSource("DataSet1", dtInvoiceVMSSubTaxSubReport);
        e.DataSources.Add(ds);

    }


    public static DataSet DataAdapterSelectQuery(string sqlQuery)
    {
        //TODO: Error Handling is left
        //TODO: Need global connection string
        string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["WindowsFormsApp2.Properties.Settings.VMS_DataConnectionString"].ConnectionString;

        //try                                   WindowsFormsApp2.Properties.Settings.VMS_DataConnectionString

        //{                

        using (OleDbConnection con = new OleDbConnection(connectionString))

        {

            con.Open();

            OleDbDataAdapter dAdapter = new OleDbDataAdapter(sqlQuery, con);

            DataSet dataSet = new DataSet();
            dAdapter.Fill(dataSet);

            return dataSet;
        }
        //catch (Exception ex)            
    }

错误消息是什么?“未指定某些参数或凭据”是否对参数进行硬编码?