cancel
Showing results for 
Search instead for 
Did you mean: 

When click next page of CR this prompt appear (Use DataSet)

Former Member
0 Kudos

Hi.

I have tried using CR with DataSet  and Connectivity and display fine from my code.

But when I pressed to the next page. this prompt appear(In every project to use CR with DataSet)

What are the causes? and How to fix this issue? 

CR SP 13.0.13.1597  ,  VS2013 With Update 4  and .NetFramework4.5.1

If you need more information ask me anytime.

Thank for response.   -/\-

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Typically, the cause is that the report engine does not understand the dataset being passed top it. E.g.; the something in the dataset format  is different than what the report was designed with. For troubleshooting steps see the wiki Troubleshooting Issues with VS .NET Datasets and Crystal Reports - Business Intelligence (BusinessOb...

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Former Member
0 Kudos

Hi Ludek

I have read your article but I don't know how to deploy with my code.

I think my problem is due because it's lost the session.

please help me

thank you very much.

Answers (2)

Answers (2)

Former Member
0 Kudos

Look at my code

some one help me to put load code in the Page_Init section and use Postback to keep the report in session.

If me bind my report's datasource in the button_click .

because i need the user to select a date range from the Textbox. Then click show report ,how can do it



0 Kudos

Hi Bas,

Please search, there are lots of samples on how to use PostBack methods as well as the Page_Init section.

A quick test is to simply rename the Page_Load to Page_Init.

Start with a simple test app first....

Don

0 Kudos

Put your report load code in the Page_Init section and use Postback to keep the report in session.

It's prompting because it's loading the report on each page event because it's lost the session.

Don

PS - PLEASE search, this issue has been posted multiple times.

Former Member
0 Kudos

Hi. Don Thank for response

I found similar questions with my case.

Add Session code to keep the report in session and a postback method to tell the report it is in an active session.

And See this KBA: From Ludek

SAML Response from SAP Cloud Identity

I have tried with my Code.

I don't know how to deploy with my code.

i'm using the following code.

aspx

<body>

    <form id="form1" runat="server">

    <div>

   

        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

        <asp:Button ID="Button1" runat="server" style="margin-bottom: 0px" Text="Button" />

        <br />

        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />

   

    </div>

    </form>

</body>

aspx.vb

Imports System.Data.SqlClient

Imports CrystalDecisions.CrystalReports.Engine

Public Class WebForm1

    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim objConn As New SqlConnection

        Dim objCmd As New SqlCommand

        Dim dtAdapter As New SqlDataAdapter

        Dim ds As New DataSet

        Dim dt As DataTable

        Dim strConnString, strSQL As String

        strConnString = "Server= BAS-PC\BAS ;UID=sa;PASSWORD=mypass;database=mydb;Max Pool Size=400;Connect Timeout=600;"

        strSQL = "SELECT * FROM vwReport WHERE Date BETWEEN '" & Me.TextBox1.Text & "' AND '" & Me.TextBox2.Text & "' "

        objConn.ConnectionString = strConnString

        With objCmd

            .Connection = objConn

            .CommandText = strSQL

            .CommandType = CommandType.Text

        End With

        dtAdapter.SelectCommand = objCmd

        dtAdapter.Fill(ds, "myDataTable")

        dt = ds.Tables(0)

        dtAdapter = Nothing

        objConn.Close()

        objConn = Nothing

        Dim rpt As New ReportDocument()

        rpt.Load(Server.MapPath("CrystalReport1.rpt"))

        rpt.SetDataSource(dt)

        Me.CrystalReportViewer1.ReportSource = rpt

        Me.CrystalReportViewer1.RefreshReport()

    End Sub

End Class

help me please i don't know how to deploy with my code.