Pravin Ghadge
posted
367 posts
since
Jun 23, 2010
from
|
|
Re: crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
ASSALAM-O-ALIKUM BROTHER;
YES, I HAVE ERROR IN MY CODE. BUT WHCIH TYPE OF ERROR IN MY CODE.
REGARDS, SUMAIRA MANZOOR
|
|
|
|
|
|
Pravin Ghadge
posted
367 posts
since
Jun 23, 2010
from
|
|
Re: crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
sir; i used inner join in this store procedures
|
|
|
|
|
|
Abdullah Munshi
posted
24 posts
since
Mar 05, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
Abdullah Munshi
posted
24 posts
since
Mar 05, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
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(); } ==========
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
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?)
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
can i used this namespace
using CrystalDecisions.Shared; using CrystalDecisions.CrystalReports.Engine;
|
|
|
|
|
|
Abdullah Munshi
posted
24 posts
since
Mar 05, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
Yes you have to include these namespaces to make this code work.
using CrystalDecisions.Web; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared;
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
Pravin Ghadge
posted
367 posts
since
Jun 23, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
brother;
your querry perfectly execute in querry analyzer . but one record comming many time. i just right this query "timeexec patientrecord '0001'"
|
|
|
|
|
|
Pravin Ghadge
posted
367 posts
since
Jun 23, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
brother;
this is my appli and db backup
|
|
|
|
|
|
Abdullah Munshi
posted
24 posts
since
Mar 05, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
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> <asp:Label ID="Label1" runat="server" Text="select patient reg no"></asp:Label> <asp:DropDownList ID="DropDownList_patient_reg_code" runat="server" Height="16px" Width="101px"> </asp:DropDownList> <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>
|
|
|
|
|
|
Pravin Ghadge
posted
367 posts
since
Jun 23, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
ASSALAM-O-ALIKUM SIR;
CAN U SENT ME .RAR FILE OF THIS CODE.
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
OK . I AM SENDING AGAIN MY DB FILE. DON'NT WORRY. BUT YOU CAN SEE MY APPLICATION.
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
brother; yes . my db file.
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
hello sir;
exception occur in clinic dst.xsd
|
|
|
|
|
|
Abdullah Munshi
posted
24 posts
since
Mar 05, 2010
from
|
|
Re: Crystal report is not display output(plz help me for this problem)
|
|
|
|
|
|
|
|
|
|
|
Delete existing "clinic_dst.xsd"
Then run this code & after that comment this line.
dst.WriteXMLSchema("clinic_dst.xsd")
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
u mean , i delete my clinic_dst.xsd file that i made through press right button on my clinic project. am i right.
|
|
|
|
|
|