Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Push Method in Crystal Reports Still Prompting for Database Logon

Posted on 2006-03-21
8
Medium Priority
?
955 Views
Last Modified: 2008-01-16
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.
0
Comment
Question by:jrandallsexton
  • 5
  • 3
8 Comments
 
LVL 8

Expert Comment

by:dylanyee
ID: 16247065
What is your CR version? and do you mind showing us your code of setting datasource for CR?

dylan
0
 
LVL 4

Author Comment

by:jrandallsexton
ID: 16247510
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
 
LVL 8

Expert Comment

by:dylanyee
ID: 16248212
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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
LVL 4

Author Comment

by:jrandallsexton
ID: 16248232
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
 
LVL 8

Expert Comment

by:dylanyee
ID: 16248354
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
 
LVL 8

Accepted Solution

by:
dylanyee earned 2000 total points
ID: 16248456
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
 
LVL 4

Author Comment

by:jrandallsexton
ID: 16249905
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
 
LVL 8

Expert Comment

by:dylanyee
ID: 16256105
glad I could help~

dylan
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question