Prev: Object reference not set for an instance of an object in a .ASCX f
Next: Syntax for "OR" in WHERE clause passing parameters from C# ASP.NET
From: JB on 1 Apr 2010 17:27 -- JB "Andy O'Neill" wrote: > > "JB" <JB(a)discussions.microsoft.com> wrote in message > news:A7A60A64-734F-4A6E-9154-6BE45E5AB84D(a)microsoft.com... > > Hello Community > > > > In a C# and ASP.NET app I embed a Crystal Report. In the Crystal Report I > > create a parameter field named id. Then I read one id from a table and I > > pass the id from the table to Crystal Report where Crystal Report > > creates > > the report successfully. > > > > The problem is that now I am reading atleast 5 id's each containing a > > different value from the table and I want Crystal Report to create a > > report > > for each one of the id's such that the user can use the carat and scroll > > thru all of the reports from the first one to the last. > > > > Crystal Reports creates reports like that by default if it reads the whole > > table without passing a parameter but the question is how can I get > > Crystal > > Report to create the reports like that when I pass 5 id's each > > containing a > > different value (if its possible)? > > With Crystal, my preferred method is to read data into a datatable and > substitute this for the crystal report's datasource at run time. > That way I can do whatever I like with the data without having to worry > about the various foibles of crystal. > So I'd have some way of selecting my data into that datatable that allowed 1 > or more id and hand that to crystal. > > . > Hello Andy I am thinking about creating a Dataset but your idea of a Datatable is just as good. How does Crystal Report access your Datatable and it's fields?
From: Andy O'Neill on 2 Apr 2010 06:02
"JB" <JB(a)discussions.microsoft.com> wrote in message news:348DB74F-2CEA-48F6-866D-792EAA2C3077(a)microsoft.com... <<>> > I am thinking about creating a Dataset but your idea of a Datatable is > just as good. > > How does Crystal Report access your Datatable and it's fields? A datatable is somewhat lighter weight. You can build your initial report against one thing and then switch the source at run time. If the datasource is complex I temporarilly change my select to create a table, design against that and then drop the table. |