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
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
<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.