Home > Archive > Visual Basic Crystal Reports > March 2006 > Dynamically add fields in Crystal 9, 10, or 11?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Dynamically add fields in Crystal 9, 10, or 11?
|
|
|
| Hi all,
While I have primarily used the embedded Crystal 9 in VS.NET 2003, we have
recently purchased Crystal 11, which is what I am now using. I assume,
however, that this question would be legitimate in either version.
Is there a way to dynamically add a database field to the report at runtime?
For instance, let's say I had 3 database fields (field1, field2, and
field3). At runtime, based on the report parameters I send to the report, I
tell it to add field1 and field2 to the report detail, with specific X, Y
coordinates and an appropriate width.
Is this possible?
I have a feeling that, ly, it is not. This seems to me to be a
significant oversight.
Sure, it's not a big deal in a three field example ... but try a 30 field
example, where you want to offer almost any combination of fields to the
report, with different plancement and size. You'd never create a static
report to handle that many combinations.
Thanks for the help.
Wade
| |
|
| Well, I still haven't been able to dynamically add fields to a report, but
I've been able to modify report objects at runtime (of course, the following
just displays the values, but it can be also used to change them):
For Each crSection In rdReportFile.ReportDefinition.Sections
Response.Write("<B>" & crSection.Name & "</b><BR>")
For Each crReportObject In crSection.ReportObjects
Response.Write(" " &
crReportObject.Name & " : ")
Response.Write(crReportObject.Left & " : ")
Response.Write(crReportObject.Top & " : ")
Response.Write(crReportObject.Width & "<BR>")
Next
Next
Does anyone know how to add fields dynamically at runtime, based on fields
available in the datasource? The section and report objects are read-only,
and thus do not let me create new instances.
Thanks,
Wade
"Wade" <wwegner23NOEMAILhotmail.com> wrote in message
news:OEd9isbUGHA.4772@TK2MSFTNGP14.phx.gbl...
> Hi all,
>
> While I have primarily used the embedded Crystal 9 in VS.NET 2003, we have
> recently purchased Crystal 11, which is what I am now using. I assume,
> however, that this question would be legitimate in either version.
>
> Is there a way to dynamically add a database field to the report at
> runtime? For instance, let's say I had 3 database fields (field1, field2,
> and field3). At runtime, based on the report parameters I send to the
> report, I tell it to add field1 and field2 to the report detail, with
> specific X, Y coordinates and an appropriate width.
>
> Is this possible?
>
> I have a feeling that, ly, it is not. This seems to me to be a
> significant oversight.
>
> Sure, it's not a big deal in a three field example ... but try a 30 field
> example, where you want to offer almost any combination of fields to the
> report, with different plancement and size. You'd never create a static
> report to handle that many combinations.
>
> Thanks for the help.
>
> Wade
>
|
|
|
|
|