Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report name as variable?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Divers
Thread ID:
00916127
Message ID:
00916807
Vues:
7
Ok, I'll admit I'm a 'Crystal Sucks' type of guy. I find so many things about using it very frustrating. Things I think should be very simple turn out to be 25 lines of code.

Like:
Passing a parameter to the report
I finally gave up on getting that done and just
added those type of things to the data table.

Alignment of fields on the report just plain suck

Being forced to add the dataset to the project as an .xsd
Building the dataset and tables in code is not
enough you must have the .xsd in order to design
the report

That said, I'm always willing to learn and you have totally confused me with this post.

The load function with the path was the only way I could get this to work. I have no idea how to make a report 'strongly-typed'. The reports were created within .net and are part of the project in question. I never knew the load method existed because I had always just hard coded the name of the report in the code as in your example. But that won’t work if you have the report name in a variable. In this case I am not using a viewer because I am actually creating a pdf file that I point the user’s browser too.

If you have the time and don't mind trying again to explain to me what I'm missing, I sure would like to be a little less stupid about crystal.

TIA
Jeff

>Just as a follow-up, the load function isn't necessary, depending on how the report is being generated. With a strongly-typed report, you can instantiate it by the class name and then set the preview window's reportsource to the report object, like so...
>
>RPT_MyReport oReport = new RPT_MyReport();
>oReport.Database.Tables[0].SetDataSource(MyReportTable);
>myViewer.ReportSource = oReport;
>
>In that case, the report gets compiled into the app (which can be a benefit or drawback, depending on the situation).
>
>So in that instance, yes, reflection would be the only way if you wanted to handle the name dynamically. From the lines of code that were posted, that was the direction I thought he was headed.
>
>But if you're using other methods, (untyped, report was created outside of .NET), then the report name/path can be handled by the code in his follow-up post.
>
>Kevin

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform