Crystal report show against stored procedure
My question is how to call stored procedure and set parameter in C# application for Crystal Reports show.
I have table of invoice and field is as below
companyID (int) invno(varchar)
===============================
1 101/2009-2010
2 101/2009-2010
Now suppose I have create a stored procedure
CREATE PROCEDURE sel_inv
@companyID in开发者_开发知识库t
AS
SELECT *
FROM invoice
WHERE companyID = @companyID
For displaying Crystal Report against particular ID only. if companyID = 1 then select records only companyID = 1 not for 2.
And for that how to call above procedure & pass parameter value into c# for Crystal Report.
And userID and password always asked while showing of crystal report if there is any solution for set one time userID and password through coding in c# though it's never asked again & again about it for other user.
Thanks in advance.....
You need to load the report into a ReportDocument object, then set the either the parameters using the ParameterFields collection or modify the RecordSelectionFormula, After that, pass the ReportDocument to the viewer. As for the login stuff, look at the ReportDocument's SetDatabaseLogon method.
精彩评论