Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreport printing Probelm in asp.net 2.0 Post Reply Post New Topic
Author Message
gopihere
Newbie
Newbie
Avatar

Joined: 26 May 2010
Location: India
Online Status: Offline
Posts: 1
Quote gopihere Replybullet Topic: Subreport printing Probelm in asp.net 2.0
     Posted: 26 May 2010 at 9:06pm
1. I have one problem on clicking print button in toolbar of subreport itz again come back to main report in asp.net 2.0...
so, how to take the print of subreport...?

normally im uisng this code to load page:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;



public partial class Sales : System.Web.UI.Page

{

    ReportDocument crReportDocument = new ReportDocument();

    TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();

    ConnectionInfo crConnectionInfo = new ConnectionInfo();

    CrystalDecisions.CrystalReports.Engine.Database crDatabase;

    CrystalDecisions.CrystalReports.Engine.Tables crTables;

    CrystalDecisions.CrystalReports.Engine.Table crTable;



    protected void Page_Load(object sender, EventArgs e)

    {

        string Server1 = ConfigurationManager.AppSettings["Server"];

        string user = ConfigurationManager.AppSettings["Userid"];

        string Password = ConfigurationManager.AppSettings["Password"];

        string DataBase = ConfigurationManager.AppSettings["DataBase"];

        crReportDocument.Load(Server.MapPath("Sales.rpt"));

        crConnectionInfo.ServerName = Server1;

        crConnectionInfo.DatabaseName = DataBase;

        crConnectionInfo.IntegratedSecurity = false;

        crConnectionInfo.UserID = user;

        crConnectionInfo.Password = Password;



        crDatabase = crReportDocument.Database;

        crTables = crDatabase.Tables;



        foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)

        {

            crTableLogOnInfo = crTable.LogOnInfo;

            crTableLogOnInfo.ConnectionInfo = crConnectionInfo;

            crTable.ApplyLogOnInfo(crTableLogOnInfo);

        }



        CrystalReportViewer1.ReportSource = crReportDocument;

        CrystalReportViewer1.Visible = true;

    }

}
IP IP Logged
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