471,617 Members | 1,112 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,617 software developers and data experts.

Cyrstal Reports

Is it possible to design a report at Runtime? What I am trying to do is
create a very flexible report to have a different amount of columns. The
user can choose the fields from a database table they want to show on the
report. It can be anywhere from 1 - 10 columns.

I found this Visual Basic code, but I can't convert to c# because I can't
found AddFieldObject method in c#!! ¿?

Public Sub AddToDetails()
Dim crSection As CRAXDRT.Section
Dim crFieldObject As CRAXDRT.FieldObject
Set crSection = crReport.Sections.Item("D")
Set crFieldObject = crSection.AddFieldObject("{Customer.Customer Name}",
600, 0)
End Sub

Please, can somebody help me?
Dec 29 '05 #1
2 2165
Ümit,

If by design, you mean dynamically generate, yes, it is possible.

However, I am looking at this code, and it looks like the naming is
different for the types, like the old Prog ID convention, which leads me to
believe this is VB6.

I believe the object model for CR has changed for .NET, so this code
wouldn't be valid anyways. I would look at the documentation for CR that
comes with VS.NET, and then try and use that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ümit Kavala" <um**@set-soft.com> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Is it possible to design a report at Runtime? What I am trying to do is
create a very flexible report to have a different amount of columns. The
user can choose the fields from a database table they want to show on the
report. It can be anywhere from 1 - 10 columns.

I found this Visual Basic code, but I can't convert to c# because I can't
found AddFieldObject method in c#!! ¿?

Public Sub AddToDetails()
Dim crSection As CRAXDRT.Section
Dim crFieldObject As CRAXDRT.FieldObject
Set crSection = crReport.Sections.Item("D")
Set crFieldObject = crSection.AddFieldObject("{Customer.Customer Name}",
600, 0)
End Sub

Please, can somebody help me?

Dec 29 '05 #2

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eb*************@TK2MSFTNGP11.phx.gbl...
Ümit,

If by design, you mean dynamically generate, yes, it is possible.

You better check the CR forums, AFAIK the version shipped with VS do not
allow to dynamically modify a report.
IIRC I read this in one document from CR website.

NO idea if this changed with VS 2005.
However, I am looking at this code, and it looks like the naming is
different for the types, like the old Prog ID convention, which leads me
to believe this is VB6.


Yes it's , take a look at the "Set " sentence, it's definetely VB6.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Dec 29 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ian | last post: by
5 posts views Thread by Jason Huang | last post: by
2 posts views Thread by Jason Huang | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.