Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Using ASP.NET web forms, I am writing a small app for invoice printing.

After filling in the data and click the save button, then the hidden panel appears with ReportViewer to print the invoice. However, no data appear in the ReportViewer. If panel is visible=true, the data shows, but if panel has visible=false, no data shows inside it.

I tried using static data and update panel but they do not work. If panel.visible=true, it will work.

Also, is there any better and easier technique to save data and print invoice with a single page.

Thanks in advance.

Only in the back code when page load using panel visible, there are no changes in the html.


backcode

VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Panel1.Visible = False
    End Sub

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

        If Panel1.Visible = True Then
            Panel1.Visible = False
        Else
            Panel1.Visible = True
        End If

    End Sub





HTML
ASP.NET
<pre> <asp:Button ID="Button1" runat="server" Text="Button" />
        <br />
        <asp:Panel ID="Panel1" runat="server">
           
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" SizeToReportContent="True" Height="300px" AsyncRendering="true">
                <LocalReport ReportPath="Report1.rdlc">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData" TypeName="test.FinanceReceiptDataSetTableAdapters.MainTableTableAdapter"></asp:ObjectDataSource>
        </asp:Panel>


What I have tried:

static data without parameters include,
main issue report viewer inside panel.visable=false.
Posted
Updated 10-Mar-19 21:53pm
v2

1 solution

So weird why data don't come if just panel invisible, tried data Bind for both ReportViewer And ObjectDataSource.both sides:(
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900