Print Page | Close Window

Tag Based FormParameter question

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=747
Printed Date: 14 May 2024 at 12:35am


Topic: Tag Based FormParameter question
Posted By: rtcwls
Subject: Tag Based FormParameter question
Date Posted: 24 May 2007 at 4:54pm

Hello,

Here is short intro before my question:

I am building a report that I want to show in a new window without any website headers or footers. That way, when someone views the report they will see "only" the report with the crystal toolbar.

In order to do this I am collecting parameter data on a different page with a button that will launch the report in a new window (target='_blank')

In the documentation/samples is says:

"When you develop with a reduced-code model (the tag-based application model), the CrystalReportSource control accesses and interacts with parameters through use of the Parameters framework. The Parameters framework is new to ASP.NET version 2.0. It allows parameters to be assigned to any DataSource control (in this case, a CrystalReportSource control.) These parameters can be assigned to both the main report and any subreport, should they require parameters.

A parameter is assigned from any of the following parameter types:

* ControlParameter
* QueryStringParameter
* SessionParameter
* FormParameter
* CookieParameter

This parameter assignment enables you to create a reduced-code solution, where a report's parameters can be set from selections made in DropDownList controls (or other types of controls), values in the URL query string, values retrieved from Session, posted values from form fields, or values from a Cookie."

Looking in the code for my webpage with the reportSource on it I have the folowing test parameters:

<Parameters>
<CR:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" DefaultValue=""
Name="StartNumber" PropertyName="Text" ReportName="" />
<CR:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" DefaultValue=""
Name="EndNumber" PropertyName="Text" ReportName="" />
<CR:Parameter ConvertEmptyStringToNull="False" DefaultValue="Test" Name="newParameter1"
ReportName="" />
</Parameters>

Here is my Question:

How do I assign Form Field Values to a parameter?

When I start typing in a new xml tag I get intellisense that only gives me the two options above, a plain parameter or a controlParameter. I am expecting to create something like this:

<CR:FormParameter FormID="aspnetForm" ConvertEmptyStringToNull="False" DefaultValue=""
Name="FormParameter" PropertyName="SomeTextBoxName" ReportName="" />
 
I can not find any examples of how to set the parameter from a Form value or a QueryString value even though the documentation says it is possible.

Thank you,

Art




Print Page | Close Window