Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 5th, 2007, 03:33 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Facing problem using crystal report in VS 2005

Hi,

I am working on Visual Studio 2005 using C#

I am creating report using inbuilt crystal report services

I am using crystal report viewer on my aspx page

When ever I run the page first time my report shows good results

As soon as i click on the export button or pagination button or zoom drop down from the crystal report viewer control

My page refreshes and nothings works properly.

If I change the zoom then it works for the first time, then it does not change and pagination comes in the way

1/ 1+

and if I click export and print option than the page refreshes and it is not working properly

Below is my code for cs and aspx code

My code behind code


    protected void Page_Load(object sender, EventArgs e)
    {

            CrystalReportViewer1.DataBind();
            Page.Title = "Student Progress Report";
            // Button2.Attributes.Add("Onclick", "pickDate('txtFromDate')");
            GenerateReport();
            //CrystalReportViewer1.Visible = false;
    }


    protected void GenerateReport()
    {
        string strreportPath = ConfigurationManager.AppSettings["reportPath"].ToString();

        string strDatabaseUsernameForReports = ConfigurationManager.AppSettings["DatabaseUsernameForReports"].ToString();
        string strDatabasePasswordForReports = ConfigurationManager.AppSettings["DatabasePasswordForReports"].ToString();
        string strDatabaseServernameForReports = ConfigurationManager.AppSettings["DatabaseServernameForReports"].ToString();
        string strDatabasenameForReports = ConfigurationManager.AppSettings["DatabasenameForReports"].ToString();

        ReportDocument report = new ReportDocument();
        report.Load(@"" + strreportPath + "ImageReport.rpt");

        report.SetDatabaseLogon(strDatabaseUsernameForRepo rts, strDatabasePasswordForReports, strDatabaseServernameForReports, strDatabasenameForReports);

         report.SetParameterValue("@username", "Dinesh Bali");

        CrystalReportViewer1.ReportSource = report;

        CrystalReportViewer1.Visible = true;
    }



        below is my aspx page the code is

        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />


Please help me at the earliest



Similar Threads
Thread Thread Starter Forum Replies Last Post
[2005] Crystal Report Exception Error snufse .NET Framework 2.0 3 February 26th, 2008 12:25 PM
Using Crystal in VB 2005 without Report Viewer csdunaway Crystal Reports 6 July 18th, 2007 11:48 AM
Crystal Report in VS 2005 shivvaamailak .NET Framework 2.0 0 April 6th, 2007 08:19 AM
Problem in Crystal Report in VS.NET 2005 SaeedNawazMalik .NET Framework 2.0 1 March 4th, 2006 03:59 PM
facing problem to export crystal report to PDF whi agarwal Beginning VB 6 0 November 12th, 2005 06:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.