Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: How to pass parameters from Web Form to CrystalReport in .NET


Message #1 by "Debarshi Sengupta" <dsengupta@e...> on Sun, 9 Feb 2003 13:19:59
Hi Hovik!

Thanks for ur suggestion. It works fine.
I used the SelectionFormula of CrystalReportViewer
but somehow it's not working. What I can figure out is
it's better to create Stored Proc and pass parameters to it thru code
and base ur report on the Stored Proc. This gives u flexibility and power 
as u can reuse the Stored Proc in other programs and also do minor 
changes. 

Thanks once again.
Debsoft

> Hi there:
U asked to send parameter, so my answer was for that!
I'vent used SelectionFormula yet! & to limiting report
I use the Crystal Report tools.
Bye the way I didnt get ur question.

Keep in touch,
Hovik.

----- Original Message -----
From: "Debarshi Sengupta" <dsengupta@e...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Monday, February 10, 2003 7:48 AM
Subject: [aspx_professional] Re: How to pass parameters from Web Form to
CrystalReport in .NET


Hi Hovik!

Thanks for ur reply. I'll try to implement the code snippet
u have sent. By the way, I was going thru code and I want to
clarify certain things:

If say the Form fieldname is "cboManager" and it is a combo and
I need to display those records for which Manager=<value selected in
combo>. First of all what will be the line
     crParameterField = crParameterFields["@PARAMETER_NAME"];
in my code. PARAMETER_NAME can be anything or specific.

Will the PARAMETER_VALUE be the value selected by the user in the combo?

Are these steps sufficient in displaying the report based on the specific
criteria selected by user or any additional steps are required?

Thanks once again. By the way, have you ever used the SelectionFormula of
CrystalReportViewer. I'm trying that too. Will let u know if it works.

Deb


> Hi there:
I asked it before but no1 helped me. Now I wanna help u!!!
use this folowing codes to pass parameter to Report File.
(Use '@' if u use Stored Procedure in ur report)

  reports.vekalat crReportDocument;
  ParameterFields crParameterFields;
  ParameterField crParameterField;
  ParameterValues crParameterValues;
  ParameterDiscreteValue crParameterDiscreteValue;

  private void Page_Load(object sender, System.EventArgs e)
  {
  crReportDocument = new REPORT_NAME();

  CrystalReportViewer1.ReportSource = crReportDocument;
  crParameterFields = CrystalReportViewer1.ParameterFieldInfo;
  crParameterField = crParameterFields["@PARAMETER_NAME"];
  crParameterValues = crParameterField.CurrentValues;

  crParameterDiscreteValue = new ParameterDiscreteValue();
  crParameterDiscreteValue.Value = PARAMETER_VALUE;
  crParameterValues.Add(crParameterDiscreteValue);
  }

let me know pls about that.
Hovik.

----- Original Message -----
From: "Debarshi Sengupta" <dsengupta@e...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Sunday, February 09, 2003 1:19 PM
Subject: [aspx_professional] How to pass parameters from Web Form to
CrystalReport in .NET


I'm developing an app in .NET using C# where I need to create report. I
have a (selection criteria) Web Form(.aspx) and I want that when user
selects a value in a combo on the form, then based on those values, the
report should be displayed. I want to know how the Form fields can be
accessed from Crystal reports in .NET?? How can one pass parameters from
form to crystal report?? I'm using Crystal report Viewer to view the
report.
Can somebody help...

Thanks in advance
Debsoft
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to




---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to





  Return to Index