Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: The report you requested require further informati Post Reply Post New Topic
Author Message
hsachinsaini
Newbie
Newbie
Avatar

Joined: 08 Feb 2011
Location: India
Online Status: Offline
Posts: 1
Quote hsachinsaini Replybullet Topic: The report you requested require further informati
    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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.