Skip Navigation Links
C# Corner Home
Forum Home
Latest 50
Unanswered
Win Prizes
All Time Leaders
Jump to CategoryExpand Jump to Category
Login 
    Welcome Guest!
 Search Forum For :  
X
 Login
Please login to submit a new post, reply and edit exiting posts, see user profiles, and access more features. If you are not a registered member, Register here.
User Id / Email:
Password:  
Forgot Password | Forgot UserName
   Home » C# Language » Crystal report is not display output(plz help me for this problem)
       
Author Reply
sumaira manzoor hussain khan
posted 147 posts
since Feb 23, 2010 
from

Crystal report is not display output(plz help me for this problem)

  Posted on: 04 Feb 2012       
 ASSALAM-O-ALIKUM TO ALL OF YOU;

I WROTE A STORE PROCEDURE BY THE NAME OF "PATIENTRECORD". ACTUCLLY, I AM WORKING ON CRYSTAL REPORT USING C# AND ASP.NET. IN THIS REPORT, I WILL GIVE "PATIENT REG CODE" AND THEN THIS REPORT GIVE ME INFORMATION IN THIS FORMAT.

 
 PATIENT REG CODE
DOCTOR NAME  
DATE 
 PV ID
NAME 
ADDRESS 
PHONE 
TREATMENT 
 MEDICINE










 IN THIS REPORT , I USED SEVERAL TABLES SUCH AS [CLINIC PATIENT REGISTARTION],[CLINIC DOCTOR],[CLINIC OPD INFO],[CLINIC PV TREATMENTS].
 
IF I SELECT PATIENT REG CODE FROM DROP DOWN LIST AND THEN PRESS "GENERATE PATIENT HISTORY" BUTTON. THERE IS NO RESULT OF REPORT.


sum-khan
Pravin Ghadge
posted  367 posts
since  Jun 23, 2010 
from 

 Re: crystal report is not display output(plz help me for this problem)
  Posted on: 04 Feb 2012        0  
hi Sumaira,

r u getting some error?


sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: crystal report is not display output(plz help me for this problem)
  Posted on: 05 Feb 2012        0  
ASSALAM-O-ALIKUM BROTHER;

YES, I HAVE ERROR IN MY CODE. BUT WHCIH TYPE OF ERROR IN MY CODE.

REGARDS,
SUMAIRA MANZOOR
sum-khan
Pravin Ghadge
posted  367 posts
since  Jun 23, 2010 
from 

 Re: crystal report is not display output(plz help me for this problem)
  Posted on: 05 Feb 2012        0  
Hi,

have u checked ur stored procedure working properly in Sql Management studio.

In Sql Management studio, run foll query:

exec patientrecord '0001' 
(for eg:0001 is ur 'patient_regcode' parameter. Plz enter valid value in place of '0001')

Then check that this query gives u result or not

Plz let me know.
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
hello sir;
actually i am sending "patient reg code" through "drop down list box" .in which place in my code i will put dropdown list. secondly , u saw my table in the post, am i writing correct store procedure. i means , i am fetching data from multiple tables . this store procedure correct for this scenario. 

please bhai, help me. because this problem irritate to from i week.

thanks
regards
sumaira

sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  

ASSALAM-O-ALIKUM SIR;

i write this store procedure in my query analyzer sql 2000 then after the command give this msg " The command(s) completed successfully." now this is my store procedure n the below.


ALTER procedure [dbo].patientrecord
@patient_regcode int
as
begin

select [clinic patient registartion].[patient reg code],[clinic patient registartion].[patient name],
[clinic patient registartion].address,
[clinic patient registartion].[phone no],[clinic opd info].[pv id],
[clinic doctor].[name],[clinic pv treatments].[treatment id] from [clinic patient registartion],[clinic opd info],[clinic doctor],[clinic pv treatments] where [clinic patient registartion].[patient reg code]=@patient_regcode

end

regards

sumaira

sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
sir;
i used inner join in this store procedures
sum-khan
Abdullah Munshi
posted  24 posts
since  Mar 05, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
You can use this function with your code.
Once you have filled the dataset using adapter you can call this function.

public void DisplayReport(CrystalReportViewer crv , DataSet ds , String reportname)
{
  ReportDocument rptdoc = new ReportDocument();
 
  rptdoc.Load(reportname);
  rptdoc.SetDataSource(ds);
  crv.ReportSource = rptdoc ;
  crv.DataBind();
 
}
=====================
Call it like,
DisplayReport(CrystalReportViewer1, ds, Server.MapPath("xyz.rpt"))
I hope this will work.
Abdullah
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
how can i fill my dataset using adapter. i means if i press right click on adapter and then i  press configure there is a window by the name of "adapter configuration wizard" comes. in this window there are so many querries . my question is , i will write new querry or not . actually i am not understand with your answer .plz elaborate it . and understand my scenario. i am sending adapter configuration wizard screen shot
sum-khan
Abdullah Munshi
posted  24 posts
since  Mar 05, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  


protected void Button_generate_report_Click(object sender, EventArgs e)

{

  SqlDataAdapter da = new SqlDataAdapter();

   DataTable ds = new DataTable();

   SqlCommand cmd = new SqlCommand();

   cmd.CommandText = "patientrecord"; // This is the Procedure name which we have created

cmd.CommandType = System.Data.CommandType.StoredProcedure;

cmd.Parameters.Add("@patient_regcode",SqlDbType.Int).Value = DropDownList_patient_reg_code.Text;

cmd.Connection = connection.get();

cmd.CommandType = System.Data.CommandType.StoredProcedure;

da.SelectCommand = cmd;

da.Fill(ds);

DisplayReport(CrystalReportViewer1, ds, Server.MapPath("xyz.rpt"))

}

public void DisplayReport(CrystalReportViewer crv , DataSet ds , String reportname)
{
  ReportDocument rptdoc = new ReportDocument();
 
  rptdoc.Load(reportname);
  rptdoc.SetDataSource(ds);
  crv.ReportSource = rptdoc ;
  crv.DataBind();
 
}

==========


Abdullah
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
ok. i am writing by the same method. but in the crystalviewer the error occur by the namespace.

 Error 1:
 The type or namespace name 'CrystalReportViewer' could not be found (are you missing a using directive or an assembly reference?) 
sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
can i used this namespace

using
CrystalDecisions.Shared; 
using CrystalDecisions.CrystalReports.Engine;
sum-khan
Abdullah Munshi
posted  24 posts
since  Mar 05, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
Yes you have to include these namespaces to make this code work.

using CrystalDecisions.Web;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
Abdullah
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
ASSALAM-O-ALIKUM SIR;

THE PROBLEM OF NAMESPACE HAS BEEN SOLVED. BUT AGAIN CRYSTAL REPORT DOES NOT GENERATE OUTPUT. I AM SENDING MY CODE N STORE PROCEDURE N CRYSTAL REPORT WEB FORM.

THANKS IN ADVANCE FOR MY HELP.

REGARDS
SUMAIRA MANZOOR
sum-khan
Pravin Ghadge
posted  367 posts
since  Jun 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
Sister,

have u checked my query in ur Sql query analyzer.

Plz execute foll line in query analyzer:

exec patientrecord '0001'  (for eg:assume '0001' is [patient reg code] . plz replce with appropriate value)

& Check whether it is showing some result or not.


sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
brother;

your querry perfectly execute in querry analyzer . but one record comming many time. i just right this query "timeexec patientrecord '0001'"
sum-khan
Pravin Ghadge
posted  367 posts
since  Jun 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
can u plz attach ur application & backup of database.

so i will better help u.
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
ok
sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
brother;

this is my appli and db backup
sum-khan
Abdullah Munshi
posted  24 posts
since  Mar 05, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
        protected void Button_generate_report_Click(object sender, EventArgs e)
        {
            //Conn.open();
           int regcode=Convert.ToInt32(DropDownList_patient_reg_code.SelectedValue.ToString());
          // patient_emr rpt = new patient_emr();  // It is a Crystal Report Which you made in the 2nd Step
           SqlDataAdapter da = new SqlDataAdapter();
           // DataSet dst = new DataSet();
           clinic_dst dst = new clinic_dst();
            DataTable ds = new DataTable();
            SqlCommand cmd = new SqlCommand("patientrecord",connection.get());
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("@patient_regcode",SqlDbType.Int).Value=regcode;// DropDownList_patient_reg_code.SelectedValue.ToString();
            da.SelectCommand = cmd;
            da.Fill(dst);
            //CrystalReportViewer_patientrecord.ReportSource= rpt;
            dst.WriteXmlSchema("clinic_dst.xsd");
            DisplayReport(CrystalReportViewer_patientrecord, dst, Server.MapPath("patient_emr.rpt"));
        }


        public void DisplayReport(CrystalReportViewer crv, DataSet ds, String reportname)
        {
            ReportDocument rptdoc = new ReportDocument();
            rptdoc.Load(reportname);
            rptdoc.SetDataSource(ds);
            crv.ReportSource = rptdoc;
            crv.DataBind();


        }
Execute this code first time.
After that comment this line ---- " dst.WriteXmlSchema("clinic_dst.xsd"); "
And then run your code.
At present the data is not displayed as there are no columns in the datatable in the "clinic_dst.xsd" dataset.
Also check this .aspx code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="patient_history_report.aspx.cs" Inherits="new_clinic.patient_history_report" %>

<%@ Register assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>patient_history_report</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        &nbsp;
    
        <asp:Label ID="Label1" runat="server" Text="select patient reg no"></asp:Label>
&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="DropDownList_patient_reg_code" runat="server" 
            Height="16px" Width="101px">
        </asp:DropDownList>
&nbsp;&nbsp;
        <asp:Button ID="Button_generate_report" runat="server" 
            onclick="Button_generate_report_Click" Text="generate patient history report" 
            Width="206px" />
    
        <br />
    
    </div>
    <CR:CrystalReportViewer ID="CrystalReportViewer_patientrecord" runat="server" 
        AutoDataBind="True" Height="1039px" 
         Width="901px" />
    
    </form>
</body>
</html>

Abdullah
Pravin Ghadge
posted  367 posts
since  Jun 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 07 Feb 2012        0  
hi,
Iam trying to restore ur db backup in my Sql 2008 server bt iam getting foll error:

"Error when restoring: There is already an object named sysnsobjs in the database."
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
ASSALAM-O-ALIKUM SIR;

CAN U SENT ME .RAR FILE OF THIS CODE.
sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
OK . I AM SENDING AGAIN MY DB FILE. DON'NT WORRY. BUT YOU CAN SEE MY APPLICATION.
sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
brother;
yes . my db file.
sum-khan
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
hello sir;

exception occur in clinic dst.xsd
sum-khan
Abdullah Munshi
posted  24 posts
since  Mar 05, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
Delete existing "clinic_dst.xsd" Then run this code & after that comment this line. dst.WriteXMLSchema("clinic_dst.xsd")
Abdullah
sumaira manzoor hussain khan
posted  147 posts
since  Feb 23, 2010 
from 

 Re: Crystal report is not display output(plz help me for this problem)
  Posted on: 08 Feb 2012        0  
u mean , i delete my clinic_dst.xsd file that i made through press right button on my clinic project. am i right. 
sum-khan
       
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Advertise with us
Current Version: 5.2011.3.12
 © 1999 - 2012  Mindcracker LLC. All Rights Reserved