Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Crystal Report in VS2008 doesn't display data on w Post Reply Post New Topic
Author Message
jbeteta
Newbie
Newbie


Joined: 16 Mar 2012
Online Status: Offline
Posts: 2
Quote jbeteta Replybullet Topic: Crystal Report in VS2008 doesn't display data on w
    Posted: 16 Mar 2012 at 3:24am
Hello,
I have a problem with my crystal reports in Visual Studio 2008.
My file CrystalReportxxx.rpt has an xsd file as dataschema. Database
to connect is Oracle and using stored procedures.
When I try to output it on a web page with this setting:
        oRpt.SetDatabaseLogon("userxxx", "passwordxxx")
Then report shows no data.
When I try to output it on a web page without this setting:
        oRpt.SetDatabaseLogon("userxxx", "passwordxxx")
Then report asks for credentials like logid and password of database.
This is my code:

        Dim dt As DataTable
        FunctionsOP.CreaDataTable("pkg_list.sp_list", True, ospEntry,
dt)
        Dim oRpt As New Reportes.CrystalReportxxx
        oRpt.SetDatabaseLogon("userxxx", "passwordxxx")
        oRpt.SetDataSource(dt)
        CrystalReportViewer1.ReportSource = oRpt
        CrystalReportViewer1.DataBind()
        CrystalReportViewer1.Dispose()

I suppose that when setting:
        oRpt.SetDatabaseLogon("userxxx", "passwordxxx")
and report shows no data, is because credentials are wrong.
My question is: How to bypass this credential input? Is it mandatory
to input userid, password, etc for using a xsd file in my Crystal
Report?
What is strange is when I export that report to PDF, there is no
problem. Data is shown OK and no credential is asked:

     Dim exportOpts As ExportOptions = oRpt.ExportOptions
        oRpt.ExportOptions.ExportFormatType =
ExportFormatType.PortableDocFormat
        oRpt.ExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile
        oRpt.ExportOptions.DestinationOptions = New
DiskFileDestinationOptions
        CType(oRpt.ExportOptions.DestinationOptions,
DiskFileDestinationOptions).DiskFileName = Server.MapPath("../Temp/" +
PDFName)
        oRpt.Export()
        oRpt.Close()
        oRpt.Dispose()

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Mar 2012 at 8:09am
you don't need to logon for CR if you are pushing the data.
 
have your app get the dataset from the stored proc, then set the DataSource (I think it is this...I have a class that does that and hasn't been modified in years) then call the viewer or whatever you need.
 
The DataSource type that I use when I design reports is ADO.Net.  I also, for design purposes write out the data with both the schema and the data, and point/refresh the datasource for the report in the design environment to that file. 
 
Since you are pushing the data, CR doesn't know or care about the database.
 
HTH
 
Sorry it wasn't sooner, I don't usually look at this forum (most of the others but not this one).


Edited by lockwelle - 21 Mar 2012 at 8:10am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.