issue with crystal report created from a dataset

S

Simone

Hello

Here is my issue, I created a crystal report using a data set from my
xsd. Then I created a page with the crystal report viewer control and
bound the report to it.

When I try to view the report on the browser I get a logon page even
though my dataset has a connection string saved within it. When I
preview the data in the dataset I see it no problem. however the
report doesn't seem to know that the dataset is there or that the
dataset has the connection string saved. The connection string is my
config file with a user authentication method NOT windows
authentication.

What I am missing, I am not finding any answers online.

Thanks
Simone
 
S

sloan

Here is the CR KB
http://support.businessobjects.com/communityCS/TechnicalPapers/rtm_reportingoffadonetdatasets.pdf



Note they use a sloppy method to populate their dataset.


The best way is to populate the dataset seperate from anything else.

Here is the main crux of that KB (and their sloppy hugarian notation)



MyStrongDS ds = SomeClass.GetTheDataSet();


// The ds should be fully populated at this point............

oRpt = new CustomerSales ();
oRpt.SetDataSource (ds);
CrystalReportViewer1.ReportSource = oRpt;
 
S

Simone

Thanks for your quick reply.

However I am having issues still. I am really new to this.. so sorry
for my poor knowlege on this.
I am all confused on the oRpt, what is that? The code declares public
customerSales oRpt = null >>> not sure what this is???
BTW I am using visual basic and not c sharp.

Looks like I have to bind the data set to the report viewer on the
page load of the page where the report viewer lives.
so if my report viewer is called CrystalReportViewer1 and my report is
already attached to it (report name = test.rpt).

How do I do that?
The xsd file is called CRReporsTest and the table adapter is called
PtRoster.

Please help. Thanks
-S
 
S

Simone

Here is the CR KBhttp://support.businessobjects.com/communityCS/TechnicalPapers/rtm_re...

Note they use a sloppy method to populate their dataset.

The best way is to populate the dataset seperate from anything else.

Here is the main crux of that KB (and their sloppy hugarian notation)

MyStrongDS ds = SomeClass.GetTheDataSet();

// The ds should be fully populated at this point............

oRpt = new CustomerSales ();
oRpt.SetDataSource (ds);
CrystalReportViewer1.ReportSource = oRpt;










- Show quoted text -

Thanks for your quick reply.

However I am having issues still. I am really new to this.. so sorry
for my poor knowlege on this.
I am all confused on the oRpt, what is that? The code declares public
customerSales oRpt = null >>> not sure what this is???
BTW I am using visual basic and not c sharp.

Looks like I have to bind the data set to the report viewer on the
page load of the page where the report viewer lives.
so if my report viewer is called CrystalReportViewer1 and my report is
already attached to it (report name = test.rpt).

How do I do that?
The xsd file is called CRReporsTest and the table adapter is called
PtRoster.

Plesae help. Thanks
 
S

sloan

oRpt is code found in the KB I sent you.

Aka, you have to read that KB to then understand what I am talking about.

................

oRpt is also an instance of the report in CR that you right. Aka, I think
its the ReportName.rpt, without the .rpt.
Aka, if you create a new CR called EmployeeSalaries.rpt, you'll want:

oRpt = new EmployeeSalaries();
(or in vb.net dim oRpt as EmployeeSalaries = new EmployeeSalaries() )

because EmployeeSalaries is EmployeeSalaries.rpt (without the .rpt)
..............


Repost if you still are having issues.
 
S

Simone

Thanks again.

The issue is that I don't see the name of the report when I do AS.
Like
dim oRpt as EmployeeSalaries = new EmployeeSalaries() I don't see the
"EmployeeSalaries". I am thinking I have to import something like
imports.... BUT I don't know what???. The name of my report is
PtRosterInCR.rpt.

Thanks soo much.
-S
 
S

sloan

"Namespace" is what you're looking for.

in C#, you'd see it like this.


namespace MyCompany.MyApplication.Data
{
public class EmployeeData{}
}


In vb.net, they (MS) kinda hide it from you.

Go to the project that has your PtRosterInCR class.
Right click it. Somewhere you'll find "Default Namespace"

Maybe something like
MyApplication.ReportDefinitions (whatever you find in the properties )

The fully qualified of your object is then:
MyApplication.ReportDefinitions.PtRosterInCR

So you can either do this

dim rpt as MyApplication.ReportDefinitions.PtRosterInCR = new
MyApplication.ReportDefinitions.PtRosterInCR()

OR

Imports MyApplication.ReportDefinitions
(top)

and then
dim rpt as PtRosterInCR = new PtRosterInCR


Something like that.

Make sure you "Add reference" to MyApplication.ReportDefinitions (assembly)
if you've got your rpt files in a seperate assembly.



................

This is probably my biggest nuisance complaint about VB.net.

It hides the namespace. And you always have to manually type in .


Namespace ReportFiles


End Namespace

It drives me nuts when I gotta go over to vb.net.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top