Print Page | Close Window

The report you requested require further informati

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12254
Printed Date: 13 May 2024 at 11:06pm


Topic: The report you requested require further informati
Posted By: hsachinsaini
Subject: The report you requested require further informati
Date Posted: 08 Feb 2011 at 1:04am
hi,whats wrong in this code,it ask for the report you requested require further information,thanks in advance



using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Web.Services;
using System.Collections.Generic;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

public partial class CrystalReportProformaInvoice : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
    SqlCommand cmdPrintReportInformation = new SqlCommand();
    ReportDocument MyReport = new ReportDocument();
    string server = @"EOTREENA\SQLEXPRESS";
    string database = "Inventory";
    string user = "UserInventory";
    string password = "admin";
    
    public static string strProformaInvoiceID;
    protected void Page_Load(object sender, EventArgs e)
    {
               strProformaInvoiceID = Session["ProformaInvoiceID"].ToString();
               cmdPrintReportInformation = new SqlCommand("SP_PrintReport_SD_ProformaInvoiceInformation_View", con);
               cmdPrintReportInformation.CommandType = CommandType.StoredProcedure;
               cmdPrintReportInformation.Parameters.AddWithValue("@ProformaInvoiceID", strProformaInvoiceID);
               con.Open();
               SqlDataAdapter da = new SqlDataAdapter(cmdPrintReportInformation);
               DataSet1 ds = new DataSet1();
               da.Fill(ds, "ProformaInvoice");
               MyReport.Load(Server.MapPath("ProformaInvoiceCrystalReport.rpt"));
               SetConnectionInfo(server, database, user, password);
               MyReport.SetDataSource(ds.Tables["ProformaInvoice"]);
               CrystalReportViewer1.ReportSource = MyReport;
               CrystalReportViewer1.DataBind();
               con.Close();
    }
    public void SetConnectionInfo(string server, string database, string user, string password)
    {
            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            logOnInfo = MyReport.Database.Tables[0].LogOnInfo;
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo = logOnInfo.ConnectionInfo;
            connectionInfo.DatabaseName = database;
            connectionInfo.ServerName = server;
            connectionInfo.UserID = user;
            connectionInfo.Password = password;
            MyReport.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
    }
}


-------------
sachin



Print Page | Close Window