15,899,314 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13505603 (Top 7 by date)
Member 13505603
6-Dec-19 14:32pm
View
Thank you Aung ,
the solution working now the error of show blank screen after publish was the SAP crystal reports runtime engine , I installed runtime engine for crystal reports then I copied the folder aspnet_client under mr site root folder
Member 13505603
6-Dec-19 0:31am
View
I tried this now no errors but when i click the button its not show the report :
SqlCommand cmd = new SqlCommand("GET_ORDER_RESULT_PRINT_CASH", cn);
cmd.Parameters.AddWithValue("@ORDER_ID",Convert.ToInt32(TXTORDERID.Text));
cmd.Parameters.AddWithValue("@deptid",Convert.ToInt32(TXTDEPTID.Text));
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.SelectCommand.CommandType = CommandType.StoredProcedure;
DataTable dt = new DataTable();
sda.Fill(dt);
ReportDocument reportDocument1 = new ReportDocument();
reportDocument1.Load(Server.MapPath("~/RPT/RPT_CASH_RESULT.rpt"));
reportDocument1.SetDataSource(dt);
CrystalReportViewer1.ReportSource = reportDocument1;
var connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "dba";
connectionInfo.DatabaseName = "DBA";
connectionInfo.Password = "DBA";
connectionInfo.UserID = "DBA";
connectionInfo.Type = ConnectionInfoType.SQL;
connectionInfo.IntegratedSecurity = false;
for (int i = 0; i < CrystalReportViewer1.LogOnInfo.Count; i++)
{
CrystalReportViewer1.LogOnInfo[i].ConnectionInfo = connectionInfo;
}
Member 13505603
5-Dec-19 23:40pm
View
Thank you sir for helping me
I changed it but still have same error
Procedure or function 'GET_ORDER_RESULT_PRINT_CASH' expects parameter '@ORDER_ID', which was not supplied.
in the line
sda.Fill(dt);
can i make link between datatable and parameters in sda.fill ?
Member 13505603
29-Nov-19 1:11am
View
I changed the code but getting now new error :
protected void BtnCrystal_Click(object sender, EventArgs e)
{
if (Session["patientno"] != null && Convert.ToInt32(Session["patientno"]) > 0)
{
SqlCommand cmd = new SqlCommand("GET_ORDER_RESULT_PRINT_CASH", cn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
ReportDocument reportDocument1 = new ReportDocument();
reportDocument1.Load(Server.MapPath("~/RPT/RPT_CASH_RESULT.rpt"));
reportDocument1.SetDatabaseLogon("DBA", "1111");
reportDocument1.SetParameterValue("@ORDER_ID", TXTORDERID.Text);
reportDocument1.SetParameterValue("@deptid", TXTDEPTID.Text);
reportDocument1.SetDataSource(dt);
CrystalReportViewer1.ReportSource = reportDocument1;
CrystalReportViewer1.DataBind();
var connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "SQL";
connectionInfo.DatabaseName = "DB";
connectionInfo.Password = "1111";
connectionInfo.UserID = "DBA";
connectionInfo.Type = ConnectionInfoType.SQL;
connectionInfo.IntegratedSecurity = false;
for (int i = 0; i < CrystalReportViewer1.LogOnInfo.Count; i++)
{
CrystalReportViewer1.LogOnInfo[i].ConnectionInfo = connectionInfo;
}
}
when click the button its giving the following error now Additional information: Procedure or function 'GET_ORDER_RESULT_PRINT_CASH' expects parameter '@ORDER_ID', which was not supplied , I already added the parameters where is the error ?
Member 13505603
28-Nov-19 23:51pm
View
Deleted
For me i am using stored procedure and passing parameters to crystal reports how to set the data source for stored procedure from the example you give ?
this is my stored procedure :
ALTER proc [dbo].[GET_ORDER_RESULT_PRINT_CASH]
@ORDER_ID int,
@deptid int
as
SELECT * FROM (
SELECT [LAB_RESULTS].ORDER_ID as 'order number'
,labtests.TestId as 'Test Id'
,labtests.TestName as 'Test Name'
,NORMAL_RESULT as 'Normal'
,APPROVED_DATE as 'Report Date'
,CASE WHEN coalesce([RESULT_NUMBER],'') <> '' THEN RESULT_NUMBER WHEN coalesce(RESULT_REPORT, '') <> '' THEN RESULT_REPORT END AS Result
,[RESULT_NOTE] as 'Notes'
,TestsRanges.LowerLimit as 'Low Range'
,TestsRanges.UpperLimit as 'High Range'
,TestsRanges.panic_value as 'Panic'
,TestsRanges.text_range as 'Text Range'
,LAB_RESULTS.CUSTID as 'Customer No'
,Customers.CustName as 'Customer Name'
,LAB_RESULTS.patient_no as 'Patient No'
,Patients.PATIENT_NAME as 'Patient Name'
,LAB_RESULTS.REQ_FORM_NO as 'REQ. FORM NO.'
,null as 'Category'
,Patients.Age AS 'AGE'
,gender.gendername as 'SEX'
,labtests.TestNotes as 'Test Note'
,TestsUnits.UnitName as 'UNIT'
,LAB_RESULTS.deptid AS 'DEPTID'
,Lab_Hematology_Samples.COLLECTION_DATE as 'Collection Date'
,Lab_Hematology_Samples.RECEIVING_DATE as 'Receiving Date'
,null AS 'Group Name'
,LAB_RESULTS.SERIAL
,LAB_RESULTS.GROUPID
,LAB_RESULTS.packageid
,LAB_RESULTS.EXAMINED_BY
,LAB_RESULTS.APPROVED_BY
,LAB_RESULTS.UPDATED_BY
,LAB_RESULTS.UPDATED_DATE
FROM [dbo].[LAB_RESULTS]
inner join LabTests on LabTests.testid=LAB_RESULTS.TESTID
inner join TestsRanges on TestsRanges.TestId = LAB_RESULTS.TESTID
inner join Customers on Customers.CustId=LAB_RESULTS.CUSTID
inner join patients on Patients.Patient_No = LAB_RESULTS.patient_no
inner join machines on lab_results.machine_id = machines.machine_id
inner join gender on gender.genderid = Patients.Gender
inner join TestsUnits on TestsUnits.UnitId = LabTests.UnitId
inner join Lab_orders_Cash on Lab_orders_Cash.cash_order_id = LAB_RESULTS.ORDER_ID
inner join PatientCat on (patientcat.CatId = Lab_orders_Cash.CatId)
inner join Lab_Hematology_Samples on Lab_Hematology_Samples.SAMPLE_ID = LAB_RESULTS.SAMPLE_ID
inner join Groups on (Groups.groupid = LAB_RESULTS.GROUPID and Groups.Testid = LAB_RESULTS.TESTID )
where lab_results.ORDER_ID = @ORDER_ID
and (Lab_orders_Cash.catid = TestsRanges.CatId )
and LAB_RESULTS.EXAMINED_DATE is not null
and LAB_RESULTS.APPROVED_DATE is not null
and LAB_RESULTS.update_count in (select max(update_count) from LAB_RESULTS where SAMPLE_STATUS = 6 and deptid = @deptid and ORDER_ID = @ORDER_ID)
and LAB_RESULTS.SAMPLE_STATUS = 6
and LAB_RESULTS.deptid = @deptid
AND TestsRanges.machine_id = LAB_RESULTS.machine_id
and (Patients.Gender = TestsRanges.PatientSex or TestsRanges.PatientSex = 1 )
UNION ALL
SELECT
[LAB_RESULTS].ORDER_ID as 'order number'
,labtests.TestId as 'Test Id'
,labtests.TestName as 'Test Name'
,NORMAL_RESULT as 'Normal'
,APPROVED_DATE as 'Report Date'
,CASE WHEN coalesce([RESULT_NUMBER],'') <> '' THEN RESULT_NUMBER WHEN coalesce(RESULT_REPORT, '') <> '' THEN RESULT_REPORT END AS Result
,[RESULT_NOTE] as 'Notes'
,TestsRanges.LowerLimit as 'Low Range'
,TestsRanges.UpperLimit as 'High Range'
,TestsRanges.panic_value as 'Panic'
,TestsRanges.text_range as 'Text Range'
,LAB_RESULTS.CUSTID as 'Customer No'
,Customers.CustName as 'Customer Name'
,LAB_RESULTS.patient_no as 'Patient No'
,Patients.PATIENT_NAME as 'Patient Name'
,LAB_RESULTS.REQ_FORM_NO as 'REQ. FORM NO.'
,patientcat.CatName as 'Category'
,Patients.Age AS 'AGE'
,gender.gendername as 'SEX'
,labtests.TestNotes as 'Test Note'
,TestsUnits.UnitName as 'UNI
Member 13505603
25-Feb-19 0:32am
View
what if i have 3 parameters how to add it
string OrderNum = ((Label)iRow.Cells[0].Controls[1]).Text;
string OrderNum = ((Label)iRow.Cells[1].Controls[1]).Text;
string OrderNum = ((Label)iRow.Cells[2].Controls[1]).Text;
is this way correct ?
Member 13505603
30-Jan-19 17:23pm
View
thank you for your help i created the following code onclick for linkbutton
protected void Lnkresult_Click(object sender, EventArgs e)
{
GridViewRow iRow = ((GridViewRow)((LinkButton)sender).NamingContainer);
//Assuming you first column is where your "lblOrder" is.
string OrderNum = ((Label)iRow.Cells[0].Controls[1]).Text;
string Deptid = ((Label)iRow.Cells[1].Controls[1]).Text;
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load("~/RPT/RPT_RESULTS.rpt");
reportDocument.SetParameterValue("@ORDER_ID", OrderNum);
reportDocument.SetParameterValue("@deptid", Deptid);
}
but when i click print result the following error show
Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
the error in this line :
reportDocument.Load("~/RPT/RPT_RESULTS.rpt");
Can I run the report direct from the path or i need to add it to another webform first with crystal report viewer and run that webform ?
Show More