cadolfo_2000 wrote:
Simply CR does not see the connection string that LLBLGen Pro reads.
The only way that it works it creating the database connection again, but I dont want it. I want to bind data the same way that I do with WIN FORMS.
Do you have any example that I can follow.
Thanks,
What I think you're asking for here is to select an entity as an object type and bind to it in the same way you bind to an object in a windows form, in the crystal designer.
If this is the case, than I'm sorry to tell you that you can't do that. The project data is only in the project scope, so if you're creating the crystal report in your UI project, you won't be able to see the DAL objects. This (IMHO) is a pretty serious design flaw in crystal component. Regardless, your not without options. You could
a.) Create the crystal report in the DAL at which point you would be able to see the entity object. However going this route you would have to re-add your reports to this project every time you regenerated your DAL, so I'm pretty sure you don't want this option.
b.) You could go with Rogelio's option which is a pretty elegant approach to the problem
c.) You could create a strong typed dataset manually and then fill the strong type set with the entity data and create the report of the dataset.
d.) You could use a sproc in the database and have the crystal designer bind to the procedure.
Personally when I create crystal reports (which is more than I care to admit) I go with option d. I create the reports in the crystal designer (external to VS) using their "pull" model. I then use a crystal report document object to call the report. I actually have a table with the reports and report parameters along with their control types so that I can add reports to the software without rebuilding the code.
The biggest pro that I see in going this way is that reports are the items most often changed within software (or at least they are in my experience) by doing it this way, I can simply modify the proc and copy a new report file over, no rebuild is necessary.
That's my .02
Justin