Push Method in Crystal Reports Still Prompting for Database Logon

Hello:

I am using the "push" method to set a strongly-typed report's datasource to a dataset that I create at runtime.  The report was designed from an XML file that I wrote using the dataset.  (i.e. I created the dataset in code, used the WriteXML method, and designed the report from that datasource).

If I write the XML filed everytime I generate the report, all is ok, but when I remove the XML file (it is not to be written in production), the report viewer prompts for database logon information - even though I am pushing a dataset to it.

Anyone have any ideas?  This is very urgent.  Max points awarded.
LVL 4
jrandallsextonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dylanyeeCommented:
What is your CR version? and do you mind showing us your code of setting datasource for CR?

dylan
0
jrandallsextonAuthor Commented:
All Crystal dlls are 9.1.5000.0

Hmm, I'm going to chop up my code quite a bit to keep it condensed ....

'**********************************************
' This code comes from a report selection screen
Dim dstReportData As DataSet
dstReportData = sqlFacade.GetDataSet(some report parameters go here)

'at this point, I can verify that the dataset is loaded by using this statement:
dstReportData.WriteXML(Application.StartUpPath & "\reportData.xml")

Dim rptc As New rptIH0152 'my strongly-type Crystal Report
Dim frmRD As New frmReportDisplay(rptc, dstReportData)
frmRD.ShowDialog
' END **********************************************

'**********************************************
' This code comes from the report viewer form - actually within the form load event
Me.m_objCrystalReport.SetDatasource(Me.m_dstReportData) 'this equates to rptc.SetDataSource(dstReportData) - the names are changed in the contstructor of the form
Me.CrystalReportViewer1.ReportSource = Me.m_objCrystalReport
' END **********************************************

Now, with that being said, why should I need to use ...
Me.m_objCrystalReport.SetDatabaseLogon(blah, blah, blah, blah)
... since I am stuffing a dataset into it?
Also, it works fine if I write the dataset as XML - but that is not possible in this situation.





0
dylanyeeCommented:
I am not familiar with strongly-type report. But I am sure that your databinding did not success or else it won't prompt you for database logon.

Is Dim frmRD As New frmReportDisplay(rptc, dstReportData) a standard way to bind dataset to report? is other report having the same problem?

Or could you try out something like:
rptc.Database.Tables("YourTableName").setDataSource(dstReportData)
Dim frmRD As New frmReportDisplay(rptc)
....


dylan
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

jrandallsextonAuthor Commented:
None of them have problems when I write the dataset to an XML file.  It's like the report is still searching for the XML from which it was designed - even when I push the dataset to it.

How do I keep it from looking for the XML file and basically shut up and take the data I give it?
0
dylanyeeCommented:
certainly all your reports will not have problem if you write dataset to an xml file, because they are originaly refer to xml file as datasource.
There must be something to do with the databinding (set data source), once databinding is succeed, it will ignore all the data connection.

dylan
0
dylanyeeCommented:
Could you take a look from this strongly type report example? it use a method rptc.SetDataSource(ds) to set datasource to the report. The example is in C#, you may need to convert it to VB.

http://www.codeproject.com/aspnet/crystal_report.asp

dylan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jrandallsextonAuthor Commented:
Awesome!

The article pointed out to me that my generated dataset was not being named the same as the XML file on which I based the report.  As soon as I set the DataSetName of the DataSet and the TableName of the table, everything worked beautifully.

Thanks again for your help.  Good job.
0
dylanyeeCommented:
glad I could help~

dylan
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.