How to use only parameters on a DevExpress XtraReport File?
I'm trying to build a form page that directs to the approval page which user c开发者_开发知识库an see the report of his application and print out, then click "Send" which is the trigger of database access.
So I've built a form page, and used "Server.Transfer" to use these values in the next page. Before, I used Crystal Reports and made it work to fill the report. But now the plan has changed, I have to use DevExpress 9.1 for reporting.
When I used the Crystal Reports, I followed this way:
On the form page: "Server.Transfer" On the approval page: if (PreviousPage != null) { Control placeHolder = PreviousPage.Controls[0].FindControl("ContentPlaceHolder1"); TextBox txtName = (TextBox)placeHolder.FindControl("txtName"); } So that I could use txtName.Text easily for Crystal Reports Fields.
But now, I just couldn't get it work on DevExpress, and the samples I've been looking at are telling about filling a report with a DB connection, with a DataSet etc. I don't want to do that because the form has no membership so anyone can access DB this way, I want to start accessing DB at last, when the user views the report and Clicks "Send" on the 2nd page.
So, what way should I follow, or any tutorials about this? With parameters and no access to the DB?
Why don't you define some parameters in your report (by using report designer) and pass the data using session variables?
In the first form:
this.Session.Add("Name",txtName.Text);
In the second form, before showing the report:
MyReport.Parameters["Name"].Value = Session["Name"].ToString();;
精彩评论