I create a report in the designer, set db location (which is actually a dataset) - everything is ok.
I bind the report correctly at design time - everything is ok.
at runtime, I get a log on prompt anyway.
The database I am using is an unsecured access 2003 database. I specify datasets for the reports - so I do not know why I am getting a logon prompt when I wish to view the report.
In one instance, if I just click "Cancel" the prompt goes away and the report is displayed correctly.
HELP PLEASE :) I'm at my wit's end trying to find an answer to this issue. I've looked at support sites, discussion threads - even tried to contact Crystal/Business Objects. No help anywhere so far.
Thanks for looking into this, but I managed to solve the problem.
The solution: Create, Load/Bind the report document at RUN time - NOT in VS 2003 at Design time.
(The code that worked is attached as a code snippet.)
Background Info:
I was creating a simple form that displayed an assignment report in a viewer. The form itself was being loaded as a modal form using the ShowDialog() method. The form, when loaded, would grab an ID from its parent, and then load the dataset for the report.
Issue: I would get the logon prompt BEFORE the Load() event ever fired. I wasn't sure how I could debug this issue.
The cause:
I only have a theory, (I wish I had more time to understand this completely, but I don't) but they do seem to fit the basic facts:
1. I think the report document was created, and then tried to bind to the dataset - before the dataset was even instantiated.
Essentially, the prompt was trying to locate a datasource. Since I strongly typed the report document in the designer, the report document was created OK, but the dataset which the report was aliased to wasn't instantiated - causing Crystal to prompt for a data location.
When I clicked cancel to the logon prompt, the dataset was ultimately loaded, and then tied to the report -where the report was viewed without error.
I believe, at long last, the culprit is within the VS 2003 IDE, and how it auto-generates the necessary code for the report document (and the dataset). Since I was passing in a parameter to the dataset, maybe that prevents the dataset from being available to the report document somehow (before the form loads).
The code snippet shows that I created and filled the dataset before actually typing the report document. This solved the logon issue, and now I can sleep just a little bit easier at night knowing this.
This has been one of the most aggravating bugs I have ever had to solve. Just thought I'd throw that in.
Open in new window