This is a migrated thread and some comments may be shown as answers.

Reporting in Smart Part

3 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 01 Aug 2008, 08:54 AM
I understand that whether in Smart Part or not, Telerik works as normal like any .NET.

I have a report library like the best practice, have a report in a dll.

the sql i have programatically code in with some params supposed to be keyed in by the user. at the first time when the report is shown, there is no problem. but the moment i press a button and update the params, the whole report give me an blank report.

so i tried having a button but not do anything. pressing the button gives me the same problem. i think the moment there is a postback, the report goes blank. i have no idea what is wrong. would be very grateful if someone can help me with this.

this is my ascx.cs file.

    protected void Page_Load(object sender, EventArgs e)
    {
        ReportViewer1.Report = new LibUserReport();
    }

    protected void Button1_Click1(object sender, EventArgs e)
    {
        Label1.Text = "Datasource is null";
    }

this is my ascx file

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
    <table width="500">
        <tr>
        <td>
            <asp:Label ID="Label1" runat="server" Text="Designation"></asp:Label>
            <asp:TextBox ID="tbDesignation" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="Preview" OnClick="Button1_Click1" />
        </td>
        </tr>
        <tr>
        <td>
            <telerik:ReportViewer ID="ReportViewer1" runat="server" />
           
        </td>
        </tr>
    </table>   
</ContentTemplate>
</asp:UpdatePanel>

3 Answers, 1 is accepted

Sort by
0
Eugene
Top achievements
Rank 1
answered on 01 Aug 2008, 09:33 AM

I think i should include this other codes for a fuller picture

This is my report class file

public LibUserReport()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();

            ReportSqls _rep = new ReportSqls();
            this.DataSource = _rep.UsersReportSQL(uname, designation);
        }

this report calls another class which is below

public SqlDataAdapter UsersReportSQL(string name, string designation)
        {
            return reportSQL("SELECT Name, Designation FROM USERS WHERE NAME LIKE '%" + name + "%' AND DESIGNATION LIKE '%" + designation + "%'");
        }

what i did here is that i write my own sql and call by myself the sql with the params

0
Steve
Telerik team
answered on 01 Aug 2008, 10:11 AM
Hello Eugene,

Can you double check that you are indeed using the Q2 release which supports ASP.NET AJAX? If this is not the case, please upgrade to Q2 or remove the UpdatePanel from the user control and see if that helps.

Best wishes,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eugene
Top achievements
Rank 1
answered on 01 Aug 2008, 10:48 AM
I was going through the forums and I also found one that had what I was looking for and I am downloading the Q2 to see if it works or not. Thanks. I didnt know that previous versions could not work with AJAX.
Tags
General Discussions
Asked by
Eugene
Top achievements
Rank 1
Answers by
Eugene
Top achievements
Rank 1
Steve
Telerik team
Share this question
or