none
Reporting RRS feed

  • Question

  • Hi All!

    I'm  a bit new in developing.

    I have made data application, all components written manually with Ado.net.classes. need to make report.

    I make form for report viewer see code bellow:

    and make a report file receipt.rdlc
    but I can not see any record at report.

    can anyone help me, and show mistakes and correct code?

    Code Snippet

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using Microsoft.Reporting;
    using Microsoft.Reporting.WinForms;

    namespace ado.net
    {
    public partial class Receipt : Form
    {
    string connectionString = MDIParent.conectionText;
    string procedureString = "dbo.receiptPrint";


    public Receipt()
    {
    InitializeComponent();
    }

    private void Receipt_Load(object sender, EventArgs e)
    {


    //this.reportViewer1.RefreshReport();
    SqlConnection connect = new SqlConnection(connectionString);
    SqlCommand printCommand = connect.CreateCommand();
    printCommand.CommandText = procedureString;
    printCommand.CommandType = CommandType.StoredProcedure;
    connect.Open();
    printCommand.ExecuteNonQuery();
    connect.Close();
    DataSet printDataSet = new DataSet();
    SqlDataAdapter printDataAdapter = new SqlDataAdapter();
    printDataAdapter.SelectCommand = printCommand;
    printDataAdapter.Fill(printDataSet,"receiptPrint");
    DataTable dt = printDataSet.Tables[0];
    LocalReport rep = reportViewer1.LocalReport;
    this.reportViewer1.LocalReport.ReportEmbeddedResource = "ado.net.receipt.rdlc";
    ReportDataSource prtRcpt = new ReportDataSource("printDataset_vw_reception_first(CU02)", printDataSet.Tables["vw_reception"]);
    reportViewer1.LocalReport.DataSources.Clear();
    reportViewer1.LocalReport.DataSources.Add(prtRcpt);


    this.reportViewer1.RefreshReport();
    }
    }
    }

     

     

    Tuesday, November 25, 2008 1:09 PM